Hi Viktor,
Il 17/02/2009 1.12, [email protected] ha scritto:
2009-02-17 01:03 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbblat/tests/blatcmd.prg
% Replaced command line retrieval with hb_cmdline() call.
Thank you for other changes, but this should be reverted, as I will do
but after a your reply to this mail, because hb_cmdline() doesn't work
in same way of API GetCommandLine(), that I think should be used inside
hb_cmdline() at Windows level.
To understand the difference please try the below example and on command
line try this command and see the difference (please change
f...@address, my.smtp.server, t...@address with yours):
blatcmd - -body "Message body" -t t...@address -s "test" -server
my.smtp.server -debug -log blat.log -timestamp -q -f f...@address
as you will see, in hb_cmdline() version '"' are lost and blat doesn't
send the mail.
Best regards
Francesco
-- start of blatcmd.prg --------------------------
#include "common.ch"
PROCEDURE Main()
LOCAL cCmd := hb_cmdline()
LOCAL cCmd1 := GetParams()
LOCAL nRet
? "Simple BLAT Command interface"
? "With hb_cmdline() paramenters: "
? cCmd
? "With WAPI_GetCommandLine() paramenters1: "
? cCmd1
IF !Empty( cCmd )
? "Sending parameters to blat"
nRet := hb_BlatSend( cCmd )
? nRet
ENDIF
? "Paramenters: ", cCmd
? "Paramenters1: ", cCmd1
IF !Empty( cCmd1 )
? "Sending parameters to blat"
nRet := hb_BlatSend( cCmd1 )
? nRet
ENDIF
RETURN
STATIC FUNCTION GetParams()
LOCAL cCmd := WAPI_GetCommandLine()
LOCAL n
// Search first space after program name
n := AT( " ", cCmd )
IF n > 0
// remove program name
cCmd := SubStr( cCmd, n + 1 )
ELSE
// empty params list
cCmd := ""
ENDIF
RETURN cCmd
//-----------------------------------------
// TODO: move to hbwin lib
#pragma BEGINDUMP
#define HB_OS_WIN_32_USED
#include <windows.h>
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbstack.h"
#include "hbapierr.h"
#include "hbapifs.h"
/* GetCommandLine() returns entire command line as a single string */
HB_FUNC( WAPI_GETCOMMANDLINE )
{
hb_retc( GetCommandLine() );
}
#pragma ENDDUMP
--- end of blatcmd.prg --------------------------------
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour