tomok wrote:The code inside your WHILE loop is never going to execute because the initial state is always going to be false. user.ElementNameLength - user.ElementNameLength is always going to equal zero.
Not that, user.ENL - user.
DimensionENL
qml wrote:I just love it when users post their problems along with some code that turns out not to be the actual code they are using. What a waste of time.
I'm just modifying it in the fly. Anyway, I
really have to change it: it consist of cyrillic letters. Please, be kind/tolerate.
Code: Select all
#Prolog:
DimensionDeleteAllElements('protfcp_LongList');
#Meta:
user.MyDimension = 'protfcp_LongList';
user.LastElement = DimSiz (user.MyDimension);
If ( user.LastElement <> 0);
user.DimensionElementNameLength = Long(Dimnm(user.MyDimension, 1));
# user.DimensionElementNameLength = 6;
user.ElementName = NumberToString(user.LastElement+1);
user.ElementNameLength = Long(user.ElementName);
While ( user.ElementNameLength - user.DimensionElementNameLength < 0);
user.ElementName = '0' | user.ElementName;
user.ElementNameLength = user.ElementNameLength + 1;
End;
Elseif (user.LastElement = 0);
user.ElementName = '000001';
Endif;
DimensionElementInsert(user.MyDimension , '' , user.ElementName , 's');
#Data:
CellPutS(variable1, 'protfcp_EmittersList', user.ElementName, 'MeasuresDimensionElement1');
CellPutS(variable2, 'protfcp_EmittersList', user.ElementName, 'MeasuresDimensionElement2');
AttrPutS(variable2, 'protfcp_Longlist', user.ElementName, 'AliasName');
Now it works without errors, but it fills only last string of my spreadsheet. It seems to cycle first on Meta code and taking maxium (last) user.ElementName start cycle on Data code.
All variables set to "OTHER" in "Variables" tab.