設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 686|回復: 0
打印 上一主題 下一主題

Passing spaces into parms in SalLoadApp

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2017-11-30 05:26:33 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
SalLoadApp('C:\\Program Files\\Java\\j2re1.4.2_06\\bin\\javaw.exe ', '-jar -Xss512k ' || 'C:\\Program" "Files\\APP_EXTENSIONS\\CustSchedCustUniqFlds2.jar ' || SqlUser || ' ' || SqlPassword || ' ' || SqlDatabase || ' ' || hWndForm.frmCustomerSchedule.dfsCustomerNo || ' ' || hWndForm.frmCustomerSchedule.dfsCustomerPartNo || ' ' || hWndForm.frmCustomerSchedule.ecmbDocNo.i_sMyValue || ' ' || SalNumberToStrX(hWndForm.frmCustomerSchedule.dfnScheduleNo, 0) || ' ' || hWndForm.frmCustomerSchedule.dfsShipAddrNo)


---maximum length of 256 characters----
Call SalLoadApp ( 'C:\\program files\\internet explorer\\iexplore.exe' , SalStrRepeatX ( 'x',207) ) !  --> works.
Call SalLoadApp ( 'C:\\program files\\internet explorer\\iexplore.exe' , SalStrRepeatX ( 'x',208) ) !  --> NOT works.[/code]

How SalLoadApp Works

Using SalLoadApp with Command Line Arguments: You can start another application by calling SalLoadApp. You can use SalLoadApp to pass command line arguments from one application to another.

The format for SalLoadApp is: SalLoadApp( strAppName, strParameters )

where strAppName is the application to start and strParameters is the command line arguments.

A space in strParameters marks the end of one argument (token) and the start of the next (if any). For example, if you pass this string in strParameters:


SalLoadApp( 'example.exe', 'one two three' )

then strArgArray[1-3] contains "one", "two", and "three" respectively and nArgCount contains 4. Centura does not pass the spaces to the application.

To pass a space in an argument, place a double quote character before and after it. For example, to pass the string "Hello there" in strArgArray[1] and "Centura" in strArgArray[2]:

SalLoadApp( 'example.exe', 'Hello" "there ' || 'Centura' )

Those are double quote characters before and after the space between "Hello" and "there". Also, there is a space after "there" which tells Centura that this is the end of this token and the start of the next.


Centura has two system variables for command line arguments.
nArgCount is the number of command line arguments.
StrArgArray is an array of strings that contains the command line arguments.
Centura reads each command line argument into an element of strArgArray when an application starts. The 0th (Zero) element is the application name.  

strArgArray and Space Characters


You must enclose literal strings, including those which contain only spaces, in single quotes. In the example below, the strings that follow each argument and contain only a space character serve to separate the arguments.

Call SalLoadApp ( 'testapp.exe', 'DEMO' || ' ' || 'SYSADM' || ' ' || 'SYSADM' )

The above statement, written literally, would be:

SalLoadApp ( 'testapp.exe', 'DEMO SYSADM SYSADM' )
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-17 04:22 , Processed in 0.218833 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表