Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a string from EXE
Message
 
 
To
22/06/2004 10:45:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00914425
Message ID:
00916089
Views:
10
Amanda,

You should use EMPTY() function to check if string is, o well, empty. :) The NULL is not the same as empty.
* Check for empty
if EMPTY(lcDataRoot)
* Check for NULL or empty
if ISNULL(lcDataRoot) OR EMPTY(lcDataRoot)
>I am having a bit of difficulty with this. I have implemented the code as follows:
>
>parameters lcAppFolder as string
>declare ExitProcess in Win32API integer ExitCode
>_screen.visible = .f.
>set safety off
>CLEAR
>ON ERROR DO errhand WITH ERROR( ), MESSAGE( )
>
>#include f:\lang\wconnect\wconnect.h
>set procedure to wwapi additive
>set procedure to wwutils additive
>
>loAPI = createobject("wwAPI")
>lcKey = loAPI.ReadRegistryString(HKEY_CURRENT_USER, 'Software\The Harrisburg Project\EDWin\1.0\DBC Locations - Local', 'EDWIN')
>lnLength = len(lcKey)
>lcDataRoot = substr(lcKey,1,(lnLength-9))
>if isnull(lcKey)
>   lcDataRoot = lcAppFolder
>endif
>if isnull(lcDataRoot)
>   _screen.visible = .t.
>   _screen.Width = 400
>   _screen.Height = 400
>   messagebox('Severe Error, please contact the Harrisburg Project.', 'Setup Error', 16)
>   nReturnCode=256
>   =ExitProcess(nReturnCode)
> endif
>
>As you can see, I want to exit and return an error code to Tarma if lcDataRoot is empty. However, I cannot seem to get a error code. Tarma looks for a nonzero being returned by a program as an indication of failure. Am I implementing this incorrectly?
>Any advice is greatly appreicated.
>TIA
>Amanda
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform