I'm creating a lib file, in this lib file there is a sub routine, lets call it X.
In the sub X, I'm building up an ISTRING[255] (call it MyIstring).
How do I return the value of MyIstring - completely forgot this one.
The lib file is built as a project, I have an include file that declares extern all the sub routines of the lib file.
So altogether I have three files:
Myprog.iwb which uses the lib file functions.
MyInclude.inc which declares the lib file routines.
MyLibfile.lib - the actual file that contains the functions.
How do I call sub routine X in Myprog so I can access the istring contents.
Have you looked at doing GLOBAL variables in a PROJECTGLOBAL.
Example from Help:
'in the defining source file
GLOBAL myvariable
GLOBAL myfunction
DEF myvariable as UINT
SUB myfunction(a as INT),UINT
RETURN a+5
ENDSUB
-----
'in another source file
EXTERN myvariable as UINT
DECLARE EXTERN myfunction(a as INT),UINT
myvariable = myfunction(7)
OR:
'in the defining source file; "myglobals.iwb"
'file added to project just like all other source files
PROJECTGLOBAL "on"
INT myvariable_1
INT myvariable_2
DIALOG mydialog_1
PROJECTGLOBAL "off"
-----
'in all other source files
'add this line at beginning of file
$INCLUDE "myglobals.iwb"
Bill
in lib
export mysub
global sub mysub(),string
istring x(255)
x=blah.....
return x
endsub
and then in your inc file
$use "mylib.lib"
declare extern mysub(),string
then in an application:
$include "mylib.inc"
istring b(255)
b= mysub()
If I understand your question correctly
Quote from: LarryMc on July 24, 2017, 12:59:46 PM
If I understand your question correctly
Andy
Did I understand you correctly?
Larry,
Sorry for not getting back, I was really busy.
Yes you did, it fixed it for me, it's been such a long time since I was trying to do something like this I just simply couldn't remember - thanks!
I'm working on code to copy / rename a registry key and all it's sub keys and values - getting there!
Andy.
Well thanks to Bill and Larry,
I've now managed to create two new registry commands:
RegCopyKey, and RegRenameKey.
Attached is a screen shot of the results from RegCopyKey where I copy a key (and sub keys / values) from "Test" to "Test2".
RegRenameKey uses the copy key command (above) and if all is well then deletes the original key.