View Issue Details

IDProjectCategoryView StatusLast Update
0001228Far ManagerMacropublic2010-01-02 11:07
Reporterfarman Assigned Tovskirdin  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSWindowsOS VersionXP SP3
Product Version2.0 
Fixed in Version2.0 
Summary0001228: Macro Problem (wrong results in 'Index')
Descriptionindex() is case-insensitive.
There should be a parameter added (case sensitive/insensitive) to index() and similar functions to get right results. The encyclopedia should be updated.
--------------------------------------------
The result is a part of a macro "cleaning filenames from unwanted chars".
Result (look at the macro) isn't as expected: %sNew should be like %sRpl.

sIst=ÃÁÂÀÅÉÊËÈÍÎÏÓÔÒÕÚÛÙâàåáãçéêëèïîìíñõôòóúûùÿ
sRpl=AÁÂÀAEÊËÈIIIOOOOUUUâàaáaçéêeèiiiinoooouuuy
sNew=AÁÂÀAEÊËÈIIIOOOOUUUÂÀAÁAçEÊËÈIIiInOOOOUUUy

sIst=âàåáãçéêëèïîìíñõôòóúûùÿÃÁÂÀÅÉÊËÈÍÎÏÓÔÒÕÚÛÙ
sRpl=âàaáaçéêeèiiiinoooouuuyAÁÂÀAEÊËÈIIIOOOOUUU
sNew=âàaáaçéêeèiiiinoooouuuyaáâàaéêeèiiioooouuu

Steps To ReproduceExample Macro:
--------------------------------------------
%sIst = "ÃÁÂÀÅÉÊËÈÍÎÏÓÔÒÕÚÛÙâàåáãçéêëèïîìíñõôòóúûùÿ";
%sRpl = "AÁÂÀAEÊËÈIIIOOOOUUUâàaáaçéêeèiiiinoooouuuy";

%sNew = "";
%j = 0;
$WHILE ( %j < len(%sIst) )

    %c = substr(%sIst, %j, 1);
    %k = Index( %sIst, %c);

    %cNew = substr(%sRpl, %k, 1);

    %j = %j + 1;
    %sNew = %sNew + %cNew;
$END

msgbox ( "Result","sIst=" + %sIst + "\n" + "sRpl=" + %sRpl + "\n" + "\n" + "sNew=" + %sNew )
Additional Informationreported/discussed in
http://forum.farmanager.com/viewtopic.php?f=36&t=4891
TagsNo tags attached.
Build1303

Activities

vskirdin

2009-12-29 06:53

administrator   bugnote:0004737

will be changed following functions:

index() ==> S=index(S1,S2[,Mode])
rindex() ==> S=rindex(S1,S2[,Mode])

What other functions? "replace()"?

farman

2009-12-29 08:38

reporter   bugnote:0004738

1. Yes. All string "search" functions.
-- TestMacro --
%s = "Ââ";
%sNew = replace(%s,"â","x");
msgbox ( "Result","s=" + %s + "\n" + "sNew=" + %sNew )

2. There seem to be many functions (not only macros):
e.g. Panels - QuickFind with Alt....
-- Test with 2 filepairs --
"âÂ1.txt"
"Ââ2.txt"
"cC1.txt"
"Cc2.txt"
If you try QuickFind you will always get the 1. file. It's not really necessary to change QuickFind (because we get no errors) but it would look more logical and offer more possibilitys.

3. Have a nice new year. :)

vskirdin

2009-12-29 09:04

administrator   bugnote:0004739

> 2. There seem to be many functions (not only macros):
must create a new incident

vskirdin

2009-12-29 10:34

administrator   bugnote:0004740

build 1303

farman

2009-12-30 12:24

reporter   bugnote:0004744

Works fine now. Thanx very much.

Issue History

Date Modified Username Field Change
2009-12-28 20:04 farman New Issue
2009-12-29 06:50 vskirdin Status new => assigned
2009-12-29 06:50 vskirdin Assigned To => vskirdin
2009-12-29 06:53 vskirdin Note Added: 0004737
2009-12-29 08:38 farman Note Added: 0004738
2009-12-29 09:04 vskirdin Note Added: 0004739
2009-12-29 10:34 vskirdin Note Added: 0004740
2009-12-29 10:34 vskirdin Status assigned => feedback
2009-12-30 12:24 farman Note Added: 0004744
2010-01-02 11:07 vskirdin Build => 1303
2010-01-02 11:07 vskirdin Status feedback => closed
2010-01-02 11:07 vskirdin Fixed in Version => 2.0
2010-01-02 11:07 vskirdin Resolution open => fixed