Thanks for your help and attention.
J.C.
"rdc02271" <rdc0...@yahoo.com> wrote in message
news:1194955420....@o38g2000hse.googlegroups.com...
> Hello all.
> I've to quickly figure out if we can use xHarbour to port
> a DOS app to Windows/Linux.
> This application is using Blinker SWPERRLEV function.
> What is the xHArbour equivalent of SWPERRLEV?
> I just can't find info on this...
I have not had much success with this but:
You have both set and read the DOS error level, so if you check
errorlevel() for a value of between 0 and 255...
You have access to the clipboard, so a value could be written to
and read from the clipboard.
You could direct the child process' output to a text file, and
parse the file.
You have access to the registry, so a value could be written to
and read from the registry.
You have access to OLE, (Word, Excel, Access, OpenOffice
components, etc.) and communications is ongoing...
David A. Smith
Not tested, but this might probably work:
//--------------------------------//
FUNCTION SwpRunCmd( cCommand, nuMem, cRunPath, cTempPath )
LOCAL nAt, cArgs, cPresetDisk, cPresetDir, nRet
#ifndef DIR_SEPARATOR
#ifdef __PLATFORM__Windows
#define DIR_SEPARATOR '\'
#else
#define DIR_SEPARATOR '/'
#endif
#endif
IF Empty( cRunPath )
nAt := At( ' ', cCommand )
IF nAt > 0
cArgs := SubStr( cCommand, nAt )
cCommand := Left( cCommand, nAt - 1 )
ENDIF
nAt := RAt( DIR_SEPARATOR, cCommand )
IF nAt > 0
cRunPath := Left( cCommand, nAt )
cCommand := SubStr( cCommand, nAt + 1 ) + cArgs
ENDIF
ENDIF
IF cRunPath[2] == ':'
cPresetDisk := DiskName()
IF ! DiskChange( cRunPath[1] )
RETURN Throw( ErrorNew( "Blinker", 0, 1001, ProcName(), "Could not
switch to drive: " + cRunPath[1], HB_aParams() ) )
ENDIF
cRunPath := SubStr( cRunPath, 3 )
ENDIF
IF ! Empty( cRunPath )
cPresetDir := DIR_SEPARATOR + CurDir()
IF DirChange( cRunPath ) != 0
RETURN Throw( ErrorNew( "Blinker", 0, 1002, ProcName(), "Could not
switch to folder: " + cRunPath, HB_aParams() ) )
ENDIF
ENDIF
__Run( cCommand, @nRet )
SwpErrLev( nRet )
IF ! Empty( cPresetDisk )
IF ! DiskChange( cPresetDisk )
RETURN Throw( ErrorNew( "Blinker", 0, 1003, ProcName(), "Could not
switch back to drive: " + cPresetDisk, HB_aParams() ) )
ENDIF
ENDIF
IF ! Empty( cPresetDir )
IF DirChange( cPresetDisk ) != 0
RETURN Throw( ErrorNew( "Blinker", 0, 1004, ProcName(), "Could not
switch back to folder: " + cPresetDir, HB_aParams() ) )
ENDIF
ENDIF
RETURN nRet == 0
FUNCTION SwpErrLev( nLev )
STATIC s_nLastLev := 0
IF ValType( nLev ) == 'N'
s_nLastLev := nLev
ENDIF
RETURN s_nLastLev
//--------------------------------//
Ron