Page 1 of 1

Exporting more than one line of text in a fld

Posted: Sat Sep 07, 2013 4:18 pm
by wee wullie
I am trying to export text from a stack to a vb file , one of the fields has two lines of text in it, the problem is that when i try to send the data both lines are included in the string, starting and ending with a " but because i use a cr to put it into two lines it wont send it, i need each line to start and end with "
i can send it as one line ok but when i use return to put it into two lines it wont send

i hope someone knows what i mean

wee wullie

Re: Exporting more than one line of text in a fld

Posted: Sat Sep 07, 2013 4:22 pm
by Klaus
Hi wullie,

for storing (or sending or whatever) multiline text in ONE line, I always "urlEncode" the string.
And later "urlDecode" it to get the multiline text back.

No problem if you urlEncode and then urlDecode a one-liner :D


Best

Klaus

Re: Exporting more than one line of text in a fld

Posted: Sat Sep 07, 2013 5:29 pm
by wee wullie
Hi Klaus, i tried to use urlencode for the entire string and just the variable and it doesn't seem to work, this is the string:

Code: Select all

put "Tr Type:" && the selectedText of btn "TrType" of stack "myStack"  & cr & "Tk Type:" && the Text of fld "TkType"  of stack "myStack" into tParr
perhaps i'm missing something

Re: Exporting more than one line of text in a fld

Posted: Sat Sep 07, 2013 5:44 pm
by Klaus
WHAT did you try?
Something like this:
...
put "Tr Type:" && the selectedText of btn "TrType" of stack "myStack" & cr & "Tk Type:" && the Text of fld "TkType" of stack "myStack" into tParr
put urlEncode(tParr) into tVarWith_the_ONE_liner
...
?

Need to look at the script(s), since this has been working for many, many years for me 8)

Re: Exporting more than one line of text in a fld

Posted: Sat Sep 07, 2013 5:51 pm
by Klaus
You can of course urlencode your string directly, no need for an extra variable:
...
put urlencode("Tr Type:" && the selectedText of btn "TrType" of stack "myStack" & cr & "Tk Type:" && the Text of fld "TkType" of stack "myStack") into tParr
...
:)

Re: Exporting more than one line of text in a fld

Posted: Sun Sep 08, 2013 10:27 am
by wee wullie
Hi Klaus, i tried to use this:

Code: Select all

on mouseUp
   open stack "FTdoc"
   put "FTr" && "--" && fld "firstname" of stack "FTDoc" &&  fld "lastname" of stack "FTDoc"into fld "Subject" of stack "myStack"   
   put urlencode( "TrType:" && the selectedText of btn "TrType" of stack "FTDoc" & cr & "TkType:" && the Text of fld "TkType"  of stack "FTdoc") into tParr
   put tParr into fld "Body" of stack "myStack"
end mouseUp
i think this is the direct way

Re: Exporting more than one line of text in a fld

Posted: Sun Sep 08, 2013 11:41 am
by Klaus
Well, that's what I wrote in my last posting 8)

Re: Exporting more than one line of text in a fld

Posted: Sun Sep 08, 2013 12:11 pm
by wee wullie
Indeed it certainly was Klaus :oops:

its good that you can use both methods, transcript is very flexible, i love it!!!

cheers Klaus

Re: Exporting more than one line of text in a fld

Posted: Sun Sep 08, 2013 12:45 pm
by Klaus
Hi wullie,

well, sometimes it is desired to use an "intermediate" variable,
e.g. this way you can see what's in that string/variable when debugging!


Best

Klaus