Try this code. I am trying to create a directory named "Create x270 Download"...but first I filter the data....
let>Var=Create x270 Download
let>ValidChar=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890
len>Var,lenVar
let>thisDigit=0
let>MyDirectory=
Repeat>thisDigit
let>thisDigit=thisDigit+1
Midstr>Var,thisDigit,1,chkDigit
Pos>chkDigit,ValidChar,1,KeepDigit
if>KeepDigit>0
concat>MyDirectory,chkDigit
endif>
Until>thisDigit=lenVar
mdl>%MyDirectory%
wait>5
CreateDir>MyString
rem> (this will show the Cr at the beginning of the string as a pipe character)
I am on v8.0 (also tried it under 7.4...same result)
My work around is to NOT filter the first two characters if they are Cr....
CreateDir issue....
Moderators: JRL, Dorian (MJT support)
"CR" is a system variable for "Carriage Return". Try setting VAREXPLICIT=1. You then need to place %s around called variables so "CR" without %s will be interpretted as text.
Let>Var=Create x270 Download
let>ValidChar=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890
len>Var,lenVar
let>thisDigit=0
let>MyDirectory=
Repeat>thisDigit
Let>VAREXPLICIT=1
let>thisDigit=%thisDigit%+1
Midstr>%Var%,%thisDigit%,1,chkDigit
Pos>%chkDigit%,%ValidChar%,1,KeepDigit
if>%KeepDigit%>0
concat>MyDirectory,%chkDigit%
endif>
Let>VAREXPLICIT=0
Until>thisDigit=%lenVar%
mdl>%MyDirectory%
wait>5
CreateDir>MyString
rem> (this will show the Cr at the beginning of the string)
Hope this is helpful,
Dick
Let>Var=Create x270 Download
let>ValidChar=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890
len>Var,lenVar
let>thisDigit=0
let>MyDirectory=
Repeat>thisDigit
Let>VAREXPLICIT=1
let>thisDigit=%thisDigit%+1
Midstr>%Var%,%thisDigit%,1,chkDigit
Pos>%chkDigit%,%ValidChar%,1,KeepDigit
if>%KeepDigit%>0
concat>MyDirectory,%chkDigit%
endif>
Let>VAREXPLICIT=0
Until>thisDigit=%lenVar%
mdl>%MyDirectory%
wait>5
CreateDir>MyString
rem> (this will show the Cr at the beginning of the string)
Hope this is helpful,
Dick
I am sure that the system is interpreting the Cr as a carriage return, but my point is that it should not when the Cr is a part of a string. I always pass variables with %var% in place. %Cr% is not the same as %Cre%...
I appreciate your answer and I may try to change to VAREXPLICIT, but I think we should be able to stuff a variable with filtered characters without the characters being changed to a Carriage Return...
I appreciate your answer and I may try to change to VAREXPLICIT, but I think we should be able to stuff a variable with filtered characters without the characters being changed to a Carriage Return...
SW,
Support may be able to give a more complete answer, but I don't know any other reason for VAREXPLICIT to exist. This situation that you are describing is resolved by VAREXPLICIT. Without setting VAREXPLICIT to 1 "CR" is immediately interpretted as Carriage Return. It doesn't matter that it will become a part of a longer string one nanosecond later. "CR" or any other predefined variable can only be used as text by setting VAREXPLICIT to 1 or by redefining the predefined variable.
For Example:
Let>CR=C
Concat>CR,R
In that case be sure you have not defined "C" or "R". Also, you will no longer have the use of Carriage Return in the script.
Hope this is helpful,
Dick
Support may be able to give a more complete answer, but I don't know any other reason for VAREXPLICIT to exist. This situation that you are describing is resolved by VAREXPLICIT. Without setting VAREXPLICIT to 1 "CR" is immediately interpretted as Carriage Return. It doesn't matter that it will become a part of a longer string one nanosecond later. "CR" or any other predefined variable can only be used as text by setting VAREXPLICIT to 1 or by redefining the predefined variable.
For Example:
Let>CR=C
Concat>CR,R
In that case be sure you have not defined "C" or "R". Also, you will no longer have the use of Carriage Return in the script.
Hope this is helpful,
Dick
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
But it is NOT part of a string. With your original code if you step through with the debugger you will see that on the second iteration the MyDirectory is set to Cr which is the variable that contains a carriage return character. So on the third iteration it is set to carriage return + e.SkunkWorks wrote:I am sure that the system is interpreting the Cr as a carriage return, but my point is that it should not when the Cr is a part of a string. I always pass variables with %var% in place. %Cr% is not the same as %Cre%...
On the second iteration it is not PART of a string - it IS the string.
So, as Dick suggests, you want to set VAREXPLICIT to 1 to make it see Cr as a literal value rather than the variable of the same name.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?