Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
JP, Fabrice Harari, Pragma Tix, RichardRose1

Accesing variable declared in a calling program

Startbeitrag von JP am 27.03.2013 17:46

Hi All,

I have a program which creates and sets some variables. It then calls another program. In the called program these variables are not accessible unless I pass them as parameters or create them as global variables. I just want to confirm that these are the only 2 options for accesing variables created in a calling program ?




what do you call a PROGRAM ? From your question, it doesn't sound like a separate EXE, but I'm not sure what you are refering too, and worse, I don't even know if you are talking about windev, webdev or mobile

Best regards

von Fabrice Harari - am 27.03.2013 19:12
You could also use a text file of sorts to communicate values between to seperate programs in an easy way, other ways including using pipes.

von RichardRose1 - am 27.03.2013 19:18
You can use a shared memoryzone.
see : http://doc.pcsoft.fr/en-US/?1000018917&name=fmemopen_function


von Pragma Tix - am 27.03.2013 19:23
Sorry Fabrice, Richard, Pragma - my old terminology habits :) A program in my old world language is a procedure in WinDev. I have a procedure which creates some variables and then calls another procedure. Besides global variables and passing as parameters is there another way the called procedure can access the variables created in the calling procedure.

Using WinDev 17.


von JP - am 27.03.2013 19:56

a variable created inside a procedure should logically be LOCAL, therefore passing its value or address as parameter to another procedure is the best practice...

Now you could of course create a COLLECTION of procedures that use common variables and declare them as global to that collection

-OR- and that would be my choice, use a class where all variables can be decalred as member and accessed from any method (or procedures) of the class

Best regards

von Fabrice Harari - am 27.03.2013 20:41
OK, thanks Fabrice. I'll use the parameters option for my current purpose.

von JP - am 28.03.2013 09:06
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.