AJ.SENDFL

0 views
Skip to first unread message

winx

unread,
Jan 10, 2006, 10:30:43 PM1/10/06
to BRIZ
Hi,

I am using AJ.SENDFL to transfer data from pick to dos file. the dos
file was transfer but there are no content inside. May i know did i
miss any step?

CALL AJ.SendFL(0, "PARIS.SPOOLER.QUEUE", FILENAME, PC.FILE.NAME, 0,
RES)


THANKS

GVP

unread,
Jan 10, 2006, 11:43:32 PM1/10/06
to BRIZ
Hi
AJ.SendFL is old subroutine. Very slowly and unmanaged. It was created
for compatibility with old programs.
I recommend to use GP.FileXXXX subroutines.
http://briz.infotools.ru/html/033/prog6ieb.htm

>From PB subroutine
1 Open with GP.FILEOPEN
2 file operations with GP.FILEREADBLOCK, GP.FILEWRITEBLOCK
GP.FILEREADCHAR .......
3 Close file with GP.FILECLOSE

>From VB You can use:
PB subroutine
or
read/write data to/from D3 with help Obj.ReadXXXX Obj.WriteXXXX
methods
read/write data to/from PC with VB methods

If need more info or sample ask me. You can se example of use
GP.FILExxxx subroutines in GPTOOL.LoadEtalon and GPTOOL.CheckAndUpdate
subroutines in GP_TERM.LIB
like this
CALL GP.FileOpen(FV,DOSPATH:DOSNAME,"MODEWRITE|MODECREATE|DECHEX")
.....
CALL GP.FileWriteBlock(FV,OBLOCK[CURLEN,5000])
....
CALL GP.FileClose(FV)

Best regards, Grigory

winx

unread,
Jan 11, 2006, 1:17:54 AM1/11/06
to BRIZ
Thanks for the help.

i am downloading the data in PB subroutine. I want to pass back the
file to vb.
How do i do it??

Regards

skypirate

unread,
Jan 11, 2006, 1:27:24 AM1/11/06
to BRIZ
Hi Grigroy,

Winx is trying to download the PICK data to the Client PC.

Rgds,

GVP

unread,
Jan 11, 2006, 1:51:44 AM1/11/06
to BRIZ
Hi
There are some ways to make it:
=================================
If You want only place file to PC without subsequent use in the VB
program:
1 Write PB subroutine like this:
-----------------
Sub MyWriteSub(PickFileName, PCfileName)
FV=""
CALL GP.FileOpen(FV,PCfileName,"MODEWRITE|MODECREATE")
IF FV<1>>=0 THEN
OPEN PickFileName TO PFV THEN
SELECT PFV
LOOP
READNEXT PFKey ELSE EXIT
READ tmps FROM PFV,PFKey THEN
CALL GP.FileWriteBlock(FV,tmps)
* or use CALL GP.FilePutStr(FV,tmps)
END
REPEAT
CLOSE PFV
END
CALL GP.FileClose(FV)
END ELSE
*Error opening file......
END
RETURN
END
---------------
or w/o open file
---------------------
Sub MyWriteSub(PickFileName, PCfileName)
FV=""
CALL GP.SystemSub("StartCapture ":PCfileName)
OPEN PickFileName TO PFV THEN
SELECT PFV
LOOP
READNEXT PFKey ELSE EXIT
READ tmps FROM PFV,PFKey THEN
CONVERT @am TO CHAR(13) IN tmps
*or use any other convert
CRT tmps
END
REPEAT
CLOSE PFV
END
CALL GP.SystemSub("StopCapture")
RETURN
END
=========================================
I'll continue in the following posting

winx

unread,
Jan 11, 2006, 1:57:28 AM1/11/06
to BRIZ
Hi Grigroy,

I am sorry. What i mean is after finish downloading the data to pc, i
want to pass the filename of the file from pick subroutine to VB. How
do i do that?

Rgds

skypirate

unread,
Jan 11, 2006, 2:00:10 AM1/11/06
to BRIZ
Hi Winx,

not very sure about yr question?

what do you want to do?

Rgds,

winx

unread,
Jan 11, 2006, 2:08:55 AM1/11/06
to BRIZ
hi skypirate,

i want to pass back the result from my subroutine back to vb.

example: illustrate in steps
1. user key in path to download data (VB interface)
2. program call PB subroutine to download data.
3. Data download successful.
4. PB subroutine pass back result/error message to VB
5. VB program display the filename / error to user.

What i want to do is from step 4 and step 5.

Please let me know if you still do not understand. Thanks
:P

Rgds

GVP

unread,
Jan 11, 2006, 2:23:15 AM1/11/06
to BRIZ

Sub MyWriteSub(PickFileName, PCfileName, ReturnValue)
ReturnValue=Something
RETURN
----
or because any parameters is IN/OUT
---
Sub MyWriteSub(PickFileName, PCfileName)
PickFileName=Something1
PCfileName=Something2
RETURN


What you want to do further? (after 5) I think that to copy the data
into a file and then it to process it not so well.

winx

unread,
Jan 11, 2006, 2:37:43 AM1/11/06
to BRIZ
Hi,

I just want to display error message to user if file is not saved and
the filename of the data if the file is download successful.

Thanks alot for your help.

:P

GVP

unread,
Jan 11, 2006, 2:51:16 AM1/11/06
to BRIZ
example for VB side

Dim ParamStr As Variant
ReDim ParamStr(2)
ParamStr(0) = "PickFileName"
ParamStr(1) = "PCfileName"
ParamStr(2) = ""
GPDOC.ExecSubEx "MyWriteSub", ParamStr

Dim SubRes As Long
SubRes = -1
While SubRes < 0
SubRes = GPDOC.GetSubResult(ParamStr)
DoEvents
Wend

================
'ParamStr(2) is result
=================
example for PB side

Sub MyWriteSub(PickFileName, PCfileName, ReturnValue)
ReturnValue=Something
RETURN

Regards,
Grigory

GVP

unread,
Jan 11, 2006, 5:14:37 AM1/11/06
to BRIZ
You can place the data in tables (dbf, mdb, oracle sql ...) directly
from PB subroutine.
See also
DAO http://briz.infotools.ru/html/033/prog6d41.htm
ODBC http://briz.infotools.ru/html/015/prog0dbc.htm

Text or Exel files are database too.
Besides ODBC and DAO you can use GP.ExcelXXXX subroutines set for
directly work with excel from PickBasic. Unfortunately are not
documentary yet

GP.ExcelWorkbookCreate
GP.ExcelWorkbookSub
GP.ExcelSub
GP.ExcelWorkbookFn
GP.ExcelApplicationFn
GP.ExcelWorksheetSub
GP.ExcelGPRangeClose
GP.ExcelRangeSub
GP.ExcelWorksheetFn
GP.ExcelApplicationSub
GP.ExcelApplicationCreate
GP.ExcelGPRangeFn
GP.ExcelGPRangeSub
GP.ExcelWorksheetCreate
GP.ExcelWorkbookClose
GP.ExcelApplicationClose
GP.ExcelRangeClose
GP.ExcelGPRangeCreate
GP.ExcelRangeCreate
GP.ExcelRangeFn
GP.ExcelWorkbookOpen
GP.ExcelFn
GP.ExcelWorksheetClose

For example list of methods only for GP.ExcelFn and GP.ExcelSub

"GetCreator","GetActivePrinter","SetActivePrinter","Calculate",
"GetDDEAppReturnCode","ExecuteExcel4Macro","Run","SendKeys","ActivateMicrosoftApp","AddCustomList","GetAlertBeforeOverwriting","SetAlertBeforeOverwriting",
"GetAltStartupPath","SetAltStartupPath","GetAskToUpdateLinks","SetAskToUpdateLinks",
"GetEnableAnimations","SetEnableAnimations","GetBuild","GetCalculateBeforeSave",

"SetCalculateBeforeSave","GetCalculation","SetCalculation","GetCanPlaySounds",
"GetCanRecordSounds","GetCaption","SetCaption","GetCellDragAndDrop",
"SetCellDragAndDrop","CentimetersToPoints","CheckSpelling","GetClipboardFormats",

"GetDisplayClipboardWindow","SetDisplayClipboardWindow","GetCommandUnderlines","SetCommandUnderlines",
"GetConstrainNumeric","SetConstrainNumeric","GetCopyObjectsWithCells","SetCopyObjectsWithCells",
"GetCursor",
"SetCursor","GetCustomListCount","GetCutCopyMode",
"SetCutCopyMode","GetDataEntryMode","SetDataEntryMode","Get_Default",
"GetDefaultFilePath","SetDefaultFilePath","DeleteChartAutoFormat","DeleteCustomList",

"GetDisplayAlerts","SetDisplayAlerts","GetDisplayFormulaBar","SetDisplayFormulaBar",
"GetDisplayFullScreen","SetDisplayFullScreen","GetDisplayNoteIndicator","SetDisplayNoteIndicator",
"GetDisplayCommentIndicator","SetDisplayCommentIndicator","GetDisplayExcel4Menus","SetDisplayExcel4Menus",
"GetDisplayRecentFiles",
"SetDisplayRecentFiles","GetDisplayScrollBars","SetDisplayScrollBars",
"GetDisplayStatusBar","SetDisplayStatusBar","DoubleClick","GetEditDirectlyInCell",
"SetEditDirectlyInCell","GetEnableAutoComplete","SetEnableAutoComplete",
"GetEnableCancelKey",
"SetEnableCancelKey","GetEnableSound","SetEnableSound","FindFile",

"GetFixedDecimal","SetFixedDecimal","GetFixedDecimalPlaces","SetFixedDecimalPlaces",
"GetCustomListNum","GetOpenFilename","GetSaveAsFilename","Goto",
"GetHeight","SetHeight","Help","GetIgnoreRemoteRequests",
"SetIgnoreRemoteRequests","InchesToPoints","InputBox","GetInteractive",
"SetInteractive","GetIteration","SetIteration","GetLeft",
"SetLeft","GetLibraryPath","MacroOptions","MailLogoff",
"MailLogon","GetMailSession","GetMailSystem",
"GetMathCoprocessorAvailable",
"GetMaxChange","SetMaxChange","GetMaxIterations","SetMaxIterations",
"GetMemoryFree","GetMemoryTotal","GetMemoryUsed","GetMouseAvailable",
"GetMoveAfterReturn","SetMoveAfterReturn","GetMoveAfterReturnDirection","SetMoveAfterReturnDirection",
"GetName","GetNetworkTemplatesPath","GetODBCTimeout","SetODBCTimeout",
"OnKey","OnRepeat","OnTime",
"OnUndo",
"GetOnWindow","SetOnWindow","GetOperatingSystem","GetOrganizationName",
"GetPath","GetPathSeparator","GetPivotTableSelection","SetPivotTableSelection",
"GetPromptForSummaryInfo","SetPromptForSummaryInfo","Quit","GetRecordRelative","GetReferenceStyle","SetReferenceStyle","RegisterXLL","Repeat","GetRollZoom","SetRollZoom","SaveWorkspace","GetScreenUpdating",
"SetScreenUpdating","SetDefaultChart","GetSheetsInNewWorkbook","SetSheetsInNewWorkbook","GetShowChartTipNames","SetShowChartTipNames","GetShowChartTipValues","SetShowChartTipValues","GetStandardFont","SetStandardFont","GetStandardFontSize","SetStandardFontSize",
"GetStartupPath","GetStatusBar","SetStatusBar","GetTemplatesPath","GetShowToolTips","SetShowToolTips","GetTop","SetTop",
"GetDefaultSaveFormat","SetDefaultSaveFormat","GetTransitionMenuKey","SetTransitionMenuKey","GetTransitionMenuKeyAction","SetTransitionMenuKeyAction","GetTransitionNavigKeys","SetTransitionNavigKeys","Undo","GetUsableHeight","GetUsableWidth","GetUserControl",
"SetUserControl","GetUserName_","SetUserName","GetValue","GetVersion","GetVisible","SetVisible","Volatile","Wait","GetWidth","SetWidth","GetWindowsForPens","GetWindowState","SetWindowState","GetUILanguage","SetUILanguage",
"GetDefaultSheetDirection","SetDefaultSheetDirection","GetCursorMovement","SetCursorMovement","GetControlCharacters","SetControlCharacters","GetEnableEvents","SetEnableEvents","GetCountApplication","GetCountRange","RemoveAllExcelControl","RemoveExcelControl"


Regards,
Grigory

skypirate

unread,
Jan 15, 2006, 10:43:35 AM1/15/06
to BRIZ
Hi,

How to send a windows binary item from Server to client PC?

Rgds,

GVP

unread,
Jan 15, 2006, 11:39:46 AM1/15/06
to BRIZ
Hi

1 Save Item on server as HEX dump
2 Copy Item to PC from HEX

-----------------------------
for 1
-----------------------------
You can Use GPTOOL.LoadEtalon see in
http://briz.infotools.ru/html/004/prog33n2.htm
or use code:

CALL GP.FileOpen(FV,DOSPATH,"MODEREAD|DECHEX")


IF FV<1>>=0 THEN

CALL GP.FileGetLength(FV,MAXLEN)
CurLen=1;
Zap=""
LOOP
CALL GP.FileReadBlock(FV,OBLOCK,20000)
Zap:=oBlock
CurLen+=20000
IF CurLen>MaxLen THEN EXIT
REPEAT
WRITE Zap ON psf,PickRecord
CALL GP.FileClose(FV)
END ELSE
CRT "ERROR OPENING ":DosPath:" ":DosName
END
===============

-----------------------------
for 2
You can Use GPTOOL.CheckAndUpdate
http://briz.infotools.ru/html/007/prog42jp.htm
or use code :
-----------------------------
OPEN PickFile TO psf THEN
READ oBlock FROM psf,PickRecord THEN
CALL GP.FileOpen(FV,DOSPATH:DOSNAME,"MODEWRITE|MODECREATE|DECHEX")


IF FV<1>>=0 THEN

LOOP
CALL GP.FileWriteBlock(FV,OBLOCK[CURLEN,5000])
CurLen+=5000
IF CurLen>MaxLen THEN EXIT
REPEAT
CALL GP.FileClose(FV)
END
END
END ELSE
CRT "ERROR OPENING ":PickFile
END
-----------------------------
read more about service subroutines at
http://briz.infotools.ru/html/030/prog5dpw.htm
about working with PC files at
http://briz.infotools.ru/html/002/sysfile.htm and at
http://briz.infotools.ru/html/028/iofile1.htm and at
http://briz.infotools.ru/html/033/prog6ieb.htm

Regards, Grigory

Reply all
Reply to author
Forward
0 new messages