Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to copy string to another function
#1
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
#2
How these functions are related? Does a call b?
#3
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
#4
Please show the code that calls the function, and also function's code.
#5
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?
#6
Variables declared like

Code:
Copy      Help
str s1
are not the same in different functions. Declare like

Code:
Copy      Help
str+ s1
or

Code:
Copy      Help
str- s1
or pass to the function by reference:

Function1:
Code:
Copy      Help
str s1
Function2 s1
out s1
Function2:
Code:
Copy      Help
function str&s1
s1.getclip
#7
OK

I will give it a try

Thx for your help and time

Grz


Forum Jump:


Users browsing this thread: 1 Guest(s)