Posts: 128
Threads: 48
Joined: Jan 2007
Hi there,
How can i copy string x1 from function a to function b so i can use the content of it again?
It seems like when the function has ended the content of the function is 'cleared' or so or am i doing something wrong?
TIA
Posts: 12,143
Threads: 143
Joined: Dec 2002
How these functions are related? Does a call b?
Posts: 128
Threads: 48
Joined: Jan 2007
Hi,
I have a dialog which extracts text from a textbox, when a button is clicked, and another function is started to handle the task (the text is copied to s1),
The function handles the s1 string properly, at the end of the function i can out the s1 string, but after a 'ret' and getting back to the main dialog it is empty.
I want some kind of possibility to restore the last input in this string..
Can this simply be done by storing the string and calling it back (as i have tried the last couple of hours), or has something else to be done?
Cheers
Posts: 12,143
Threads: 143
Joined: Dec 2002
Please show the code that calls the function, and also function's code.
Posts: 128
Threads: 48
Joined: Jan 2007
This is what i tried to recover the s1 function in the main dialog:
out s1
s1.setwintext(id(1004 hDlg))
The s1 is populated earlier, so the problem can be here i think..
Another function uses the same s1 as called here in another function, populated this way through clipboard:
str s1
s1.getclip
After this i let a number of searches be done, at the end i can visualise the 's1' with out s1
And return to the main dialog,
All i want is a possibility to populate the (id(1004 hDlg)) with the s1 what i could read out in the other function.
I thought i had to make another string and populate it with the data like this:
str undo
undo=s1
undo.setwintext(id(1004 hDlg))
Or should i place it in another string at the last function to prevent that the string is reused and emptied before used?
Posts: 12,143
Threads: 143
Joined: Dec 2002
Variables declared like
are not the same in different functions. Declare like
or
or pass to the function by reference:
Function1:
str s1
Function2 s1
out s1
Function2:
function str&s1
s1.getclip
Posts: 128
Threads: 48
Joined: Jan 2007
OK
I will give it a try
Thx for your help and time
Grz