| Main Advantages |
|---|
| It provides the functions in a simple easy-to-use manner, avoiding the complexities of the Windows API. |
| The functions are (mostly) cross-compatible between 16 and 32 bit implementations of your program. The Taskbar functions and some advanced Comm's functions are only available in 32 bit programs, but all the other functions are the same in 16 and 32 bit programs. |
| Functionality |
|---|
| Windows message capturing functions (WinAlert) WinAlert allows your CW programs more access to the native Window messages. This is in itself nothing new. Using the sub-classing technique access to the Windows messages has been available since almost the first days of CW. WinAlert provides a simple wrapper to subclassing, which removes the complexities and makes the code both simple to follow, easy to implement, and consistent with the rest of the Clarion language. In essence one new major function, and a couple of support functions allow the flexibility and ease of use that we've come to expect from Clarion. In addition it comes with a template that makes adding this wrapper to your applications even easier. You can use the template to alert messages on individual windows. In addition a utility template makes it possible to enable Auto Shut Down across your entire application. |
| RS 232 Port functions Very often developers need simple access to a Comm's port. This simple functionality is built into the Windows API, but is quite complex and difficult to code. In addition to this the APIs for 16 bit and 32 bit Windows are very different. The Comm's section of the WinEvent package provides some simple easy-to-use functions that allow you to read and write to Comm's ports. In addition almost all the functions are the same in 16 and 32 bit ( the library takes care of the API differences ) so it's easier to move from one platform to another. The library also corrects a bug in the Windows functions that affect Comm's at speeds of greater than 19200. Some advanced functions to test specific hardware handshaking lines for their current status are only supported in 32 bit as no 16 bit equivalent exists. |
| Taskbar functions Users of Windows 95, and Windows NT 4.0, will be familiar with the Taskbar that usually sits at the bottom of the screen. The taskbar functions allow you to add / change and delete an icon from the "Tray" ( the area at the right hand side of the taskbar ) as well as detect when the mouse has been clicked on an icon in the tray. This is very useful for apps which are running in the background on a full time basis. In addition, you can make use of a function that prevents your program from appearing on the main area of the Taskbar itself. |
| Window behaviour functions A small group of functions that allow you to change the behaviour of a window. This includes the ability to make a window permanently "on top", and also the ability to bring the window to the front. |
| System functions These functions return system information to your application. The Windows, and Dos (if applicable) version numbers are available to your application. Also you are able to get the current free disk space in 16 and 32 bit. This is useful for detecting low disk space conditions before they occur. A function for playing a wav file is also included. |
| CapeSoft Support | |
|---|---|
| Telephone | +27 21 715 4000 |
| Fax | +27 21 715 2535 |
| Post | PO Box 511, Plumstead, 7801, Cape Town, South Africa |
| CapeSoft Sales | |
|---|---|
| Web | www.capesoft.com |
| Telephone | +27 21 715 4000 |
| Fax | +27 21 715 2535 |
| Post | PO Box 511, Plumstead, 7801, Cape Town, South Africa |
| Buy Online | |
|---|---|
| Web |
www.clarionshop.com |
| DLLs required (Standalone mode only) | |
|---|---|
| Clarion Version | DLL required |
| Clarion 7.3 and 8 | claWE.DLL |
| Clarion 7.1 and 7.2 | c70WE.DLL |
| Clarion 6 | WE60X.DLL |
| Clarion 5.5 | WE55X.DLL |





| Windows Message | Clarion Event posted |
| WE::WM_CLOSE | Event:CloseWindow |
| WE::WM_MOUSEMOVE WE::WM_NCMOUSEMOVE | Event:MouseMove |
| WE::WM_TIMER | Event:Timer |
| WE::WM_LBUTTONDOWN WE::WM_RBUTTONDOWN WE::WM_NCRBUTTONDOWN WE::WM_NCLBUTTONDOWN WE::WM_NCMBUTTONDOWN WE::WM_MBUTTONDOWN | Event:MouseDown |
| WE::WM_LBUTTONUP WE::WM_RBUTTONUP WE::WM_NCRBUTTONUP WE::WM_NCLBUTTONUP WE::WM_NCMBUTTONUP WE::WM_MBUTTONUP | Event:MouseUp |
| Adding WinAlert to a function | |
|---|---|
| Use the WinAlert function to alert the message. This should be called before the Accept command, but after the window is opened. | |
| Use the WinAlert function, with no parameters, before Closing the window. | |
| Use the WinEvent's WinControl, WinParam1 and WinParam2 functions to examine the message. | |
| Enabling WinAlert in the root module |
|---|
| Include the (supplied in \clarion\libsrc ) map file, EventMap.Clw, in your Global Map. |
| Include the (supplied in \clarion\libsrc ) equates file, EventEqu.Clw in your main module's data section. |
| Clarion 5: Add the Event532.Lib file to your project
for Stand-Alone compile mode or EvLib532.Lib for Local compiles.
All these library files are in your \clarion5\3rdparty\lib directory.
Clarion 5.5: Add the we55x.Lib file to your project for Stand-Alone compile mode or we55xL.Lib for Local compiles. All these library files are in your \clarion 55\3rdparty\lib directory. Clarion 6: Add the we60x.Lib file to your project for Stand-Alone compile mode or we60xL.Lib for Local compiles. All these library files are in your \clarion 60\3rdparty\lib directory. |
| Using Comms functions in a hand-coded project | |
|---|---|
| Include the (supplied in \clarion\libsrc ) map file, EventMap.Clw, in your Global Map. | |
| Include the (supplied in \clarion\libsrc ) equates file, EventEqu.Clw in your main module's data section. | |
| Clarion 5: Add
the Event532.Lib file to your project for Stand-Alone compile mode or EvLib532.Lib
for Local compiles. All these library files are in your \clarion5\3rdparty\lib directory.
Clarion 5.5: Add the we55x.Lib file to your project for Stand-Alone compile mode or we55xL.Lib for Local compiles. All these library files are in your \clarion55\3rdparty\lib directory. Clarion 6: Add the we60x.Lib file to your project for Stand-Alone compile mode or we60xL.Lib for Local compiles. All these library files are in your \clarion6\3rdparty\lib directory. | |

| Parameter | Description |
|---|---|
| FromMessage short | The [first] Windows message to alert. |
| ToMessage short | The last Windows message to alert. If this parameter is omitted then only the FromMessage is alerted. |
| Action short | This defines the action required when the alerted message(s) are received. If
this parameter is omitted then it defaults to PostUser + PassOn. |
| Equate | Meaning |
| Return0 | Return 0 to the function that sent the message. |
| Return1 | Return 1 to the function that sent the message. |
| PassOn | Pass the message on to the Clarion window for processing. |
| Equate | Meaning |
| PostUser | Post a User Event to the Accept loop. |
| PostClarion | Post an equivalent Clarion Event (if the is one) to the Accept loop. This action is only available in the registered version of the library. |
| Example |
|---|
|
code open(window) WinAlert(WM_QueryEndSession,Return0) !!! All the normal processing goes here WinAlert() ! DON'T FORGET THIS !!!!! Close(Window) |
| Example |
|---|
| code case Event() - WinMessageEvent of 0 ! WinMessageEvent case Winevent() of WM_MouseMove ! something goes here - can also use WinParam1() and WinParam2() here end of 5502 ! WM_SYSCOMMAND of 5506 ! WM_WTSSESSION_CHANGE end |
| Parameter | Description |
|---|---|
| WinMessageEvent short | The Event to post when an alerted windows message is received. |
| Example |
|---|
| code WinChangeUser(WinMessageEvent) |
| Parameter | Description |
|---|---|
| byte pClearAfterRead | Default FALSE. If set TRUE the WinSysEvent is reset to zero after reading. |
| Example |
|---|
| code case Event() - WinMessageEvent of 0 ! WinMessageEvent of 5502 ! WM_SYSCOMMAND if WinSysEvent(TRUE) = WM_SYSCOMMAND if WinSysParam1() = 61824 ! SC_CONTEXTHELP QuestionMarkPressed = TRUE end end of 5506 ! WM_WTSSESSION_CHANGE end |
| Parameter | Description |
|---|---|
| byte pClearAfterRead | Default FALSE. If set TRUE the WinWtsEvent is reset to zero after reading. |
| Value | Meaning |
| WTS_CONSOLE_CONNECT 0x1 | A session was connected to the console session. |
| WTS_CONSOLE_DISCONNECT 0x2 | A session was disconnected from the console session. |
| WTS_REMOTE_CONNECT 0x3 | A session was connected to the remote session. |
| WTS_REMOTE_DISCONNECT 0x4 | A session was disconnected from the remote session. |
| WTS_SESSION_LOGON 0x5 | A user has logged on to the session. |
| WTS_SESSION_LOGOFF 0x6 | A user has logged off the session. |
| WTS_SESSION_LOCK 0x7 | A session has been locked. |
| WTS_SESSION_UNLOCK 0x8 | A session has been unlocked. |
| WTS_SESSION_REMOTE_CONTROL 0x9 | A session has changed its remote controlled status.
To determine the status, call
|
| Example |
|---|
| code case Event() - WinMessageEvent of 0 ! WinMessageEvent of 5502 ! WM_SYSCOMMAND of 5506 ! WM_WTSSESSION_CHANGE case WinWtsEvent(TRUE) of 5 ! WTS_SESSION_LOGON NewSessionID = WinWtsID() end end |
| Parameter | Description |
|---|---|
| mode ( string ) | This is a mode string such as would be accepted
by the Dos MODE command. |
| Example |
|---|
| PortId = NewPort('Com1:9600,n,8,1') PortId = NewPort('Com2:9600,n,8,1',1024) PortId = NewPort('Com3:9600,n,8,1',1024,1024) |
| Parameter | Description |
|---|---|
| mode (string) | This is a mode string such as would be accepted by the Dos MODE command. |
| Example |
|---|
| result = ResetPort('Com1:9600,n,8,1') |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Example |
|---|
| pid = NewPort ('Com1:9600,n,8,1') ! some code goes here ClosePort(Pid) |
| Example |
|---|
| KillAllPorts() |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| String (string) | This is the handle for the string to send. Note: don't use string functions like clip, sub, etc when passing this string. |
| Length (long) | This is the number of bytes to send. If 0 then the string is clipped and sent. |
| Example |
|---|
| pid = NewPort ('Com1:9600,n,8,1') buf = 'abcdefghij' bytessent = WritePort(pid,buf,10) Note: Do not use: if WritePort(pid,buf,10) >= 0 !Successful write end instead of: bytessent = WritePort(pid,buf,10) if bytessent !Successful write end |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| String (string) | This is the handle of the string in which to put the received bytes. Note: don't use string functions like clip, sub, etc when passing this string. |
| Length (long) | This is the maximum number of bytes to receive. If 0 then the receive string will be filled if possible. |
| Example |
|---|
| pid = NewPort ('Com1:9600,n,8,1') bytesreceived = ReadPort(pid,buf,0) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| HandShake (long) | This is one of the following : 0 = No Handshaking ; 1 = Xon/Xoff ; 2 = DSR/DTR ; 3 = CTS/RTS |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') result = SetHandShake(pid,1) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') result = CtsHigh(pid) |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') result = DsrHigh(pid) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') result = RingHigh(pid) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') result = CdHigh(pid) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Value long) | Set to 0 to Clear the RTS line, Set to 1 to Set the RTS line. |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') tRts(pid,1) |
| Parameter | Description |
|---|---|
| PortId (long) | This is the port number as returned by the NewPort function. |
| Value (long) | Set to 0 to Clear the DTR line, Set to 1 to Set the DTR line. |
| Example |
|---|
| pid = NewPort('Com1:9600,n,8,1') SetDtr(pid,1) |
| Parameter | Description |
|---|---|
| IconName (string) | This is the name of the icon to display. The icon is an ICO file stored on the disk (or prefix with a '~' to use an icon in the project). |
| Tips (string) | This parameter is optional. If you put a string in here, then this will be the tip displayed when the mouse rests on the icon in the tray. |
| pSetVersion5 (byte) | |
| pIconModule (string) | this is the name of the module containing the icon (if the icon is in the project). Blank will default to the EXE. This is only required if: 1) this is not an EXE and 2) the IconName is prefixed with a '~' and 3) the icon is not in the EXEs project (but in this or another loaded DLL). |
| Example |
|---|
|
id long code open(window) id = WinTaskBarAddIcon('happy.ico','click on me....') accept !! usual window processing goes here case event() of 5513 !MouseLeftDown ! the user has clicked on the icon in the tray. ! do something here, like a popup menu... of 5514 !MouseLeftUp of 5515 !double left click of 5516 !mouserightdown of 5517 !mouserightup of 5510 !load icon of 5501 !refresh icon of 6026 ! balloon opened of 6027 ! balloon closed of 6028 ! balloon timeout, closed end end close(window) |
| Parameter | Description |
|---|---|
| Id (long) | This is the Id number as returned by the Add function. If this parameter is omitted then all icons placed by this window will be removed. |
| Example |
|---|
| id long code open(window) id = WinTaskBarAddIcon('happy.ico','click on me....') WinTaskBarRemoveIcon(id) ! or .... WinTaskBarRemoveIcon() |
| Parameter | Description |
|---|---|
| Id (long) | The Icon identifier as returned by the Add function. If omitted then the first icon added by this window will be changed. |
| IconName (string) | The name of the icon to use. |
| Tips ( string ) | The new tool tip for the icon. If omitted then the tip will be cleared. |
| pIconModule (string) | this is the name of the module containing the icon (if the icon is in the project). Blank will default to the EXE. This is only required if: 1) this is not an EXE and 2) the IconName is prefixed with a '~' and 3) the icon is not in the EXEs project (but in this or another loaded DLL). |
| Example |
|---|
| id long code open(window) id = WinTaskBarAddIcon('happy.ico','click on me....') WinTaskBarChangeIcon(id,'sad.ico','Im sooo sad') |
| Parameter | Description |
|---|---|
| pID (ulong) | Optional. Returned by WinTaskbarAddIcon. Is used to identify which icon to attach the balloon to. |
| pText (string) | The balloon text. If no balloon text is supplied then any open balloon is closed. Embedding '<13,10>' in the text produces multiline text. |
| pTitle (string) | Optional. The balloon title. Icons only appear if the title is supplied. |
| pFlags (uLong) | Optional. Default = 1 (An information
icon). WE::NIIF_ERROR EQUATE(003h) An error icon. WE::NIIF_INFO EQUATE(001h) An information icon. (Default) WE::NIIF_NONE EQUATE(000h) No icon. WE::NIIF_WARNING EQUATE(002h) A warning icon. WE::NIIF_NOSOUND EQUATE(010h) XP/Vista only. Do not play the associated sound. |
| pTimeout (ulong) | Optional. Default=1500 (15 seconds). Balloon minimum display time in 100ths of a second. (clarion time) |
| Example |
|---|
|
ID long code ID = WinTaskbarAddIcon('~MyAppIcon.ico','This is my tip text.<13,10>This is on line 2.') ds_WinTaskbarBalloon(ID,'This is the balloon text.<13,10>This is on line 2.','This is the title.') ...... ds_WinTaskbarBalloon(ID,'') ! This closes the balloon. !In the TakeEvent procedure: case Event() - WinMessageEvent of 6026 ! balloon opened of 6027 ! balloon closed - using code of 6028 ! balloon timeout or closed (using the balloon close button) of 6029 ! balloon clicked, closed end ! case |
| Example |
|---|
| code WinNotOnTaskBar() open(window) |
| Example |
|---|
| code open(window) WinOnTop() |
| Example |
|---|
|
! ------------------------------------- ! Hides Window (opposite of WindowShow) ! Useful for use with the TaskBar icon code WindowHide Routine window{prop:iconize} = true window{prop:hide} = true ! ------------------------------------- ! Shows Window (opposite of WindowHide) ! Useful for use with the TaskBar icon code WindowShow Routine if window{prop:iconize} = false window{prop:iconize} = true end window{prop:hide} = false window{prop:iconize} = false ! ------------------------------------- ! Shows Window (opposite of WindowHide) ! Useful for use with the TaskBar icon code ! No Focus is gained WindowShow_NoFocus Routine window{prop:iconize} = false window{prop:hide} = false WinOnTop() WinNotOnTop() |
| Example |
|---|
| code open(window) WinOnTop() WinNotOnTop() |
| Example |
|---|
| code open(window) WinBringToFront() |
| Parameter | Description |
|---|---|
| pGrabFocus (byte) | Optional. Defaults to TRUE. When set you window takes focus and so keyboard input goes to your window. |
| Example |
|---|
| code open(window) ds_ShowWindow() |
| Example |
|---|
| code open(window) ds_HideWindow() |
| Parameter | Description |
|---|---|
| Transparency (long) | This sets the transparency factor. 0 = Invisible, 255 = Normal. |
| Example |
|---|
| code open(window) ds_WinTransparent(255) ! normal window display ds_WinTransparent(0) ! window will be invisible |
| Parameter | Description |
|---|---|
| pWinX (*long) | Optional. If omitted then the current target window is used. If supplied then the variable is updated. |
| pWinY (*long) | Optional. If omitted then the current target window is used. If supplied then the variable is updated. |
| pWinWidth (*long) | Optional. If omitted then the current target window is used. If supplied then the variable is updated. |
| pWinHeight (*long) | Optional. If omitted then the current target window is used. If supplied then the variable is updated. |
| pMode (long) | Optional. Default=1 When set this flags that the window must not be obscured by the taskbar. |
| Example |
|---|
|
code open(window) Open(Window) ds_VisibleOnDesktop() |
| Example |
|---|
|
code DisplayString = ds_GetWinVersion() ! Win 98 - 4.10.222 A .... case sub(ds_GetWinVersion(),1,8) of 'Win 3.1' of 'Win 95' of 'Win 98' of 'Win NT' of 'Win 2K' of 'Win 2K3' of 'Win XP' of 'WinVista' of 'Win 7' of 'Win 2008' of 'Win 8' of 'Win 2012' else end |
| Example |
|---|
| code ver = WindowsVersion() |
| Example |
|---|
| code ver = WindowsVersion() rel = WindowsRelease() |
| Example |
|---|
| code ver = DosVersion() |
| Example |
|---|
| code ver = DosVersion() rel = DosRelease() |
| Parameter | Description |
|---|---|
| Drive | Optional. 0 = current drive. 1 = A, 2 = B etc. |
| Example |
|---|
| free real code free = GetFreeDiskSpace() |
| Parameter | Description |
|---|---|
| Drive | Optional. 0 = current drive. 1 = A, 2 = B etc. |
| Example |
|---|
| total real code total = GetDiskSpace() |
| Parameter | Description |
|---|---|
| pDrive (string) | Optional. Defaults to current directory. |
| pSelector (string) | Optional. Defaults to 'USER FREE'
This modifies the returned disk size. 'USER FREE' Returns the free disk space available to the current user. 'TOTAL' Returns the total disk size. 'TOTAL FREE' Returns the free disk space on the drive. |
| Example |
|---|
| total ulong code total = ds_GetDiskMegs() |
| Parameter | Description |
|---|---|
| pSelector (string) | Optional. Defaults to 'USER'
This specifies which RAM size is returned. 'USER' Returns the virtual memory used by this application. 'SWAP USED' Returns the page file used kBytes. 'SWAP FREE' Returns the page file free kBytes. 'SWAP TOTAL' Returns the page file total kBytes. 'RAM USED' Returns the physical RAM used kBytes. 'RAM FREE' Returns the physical RAM free kBytes. 'RAM TOTAL' Returns the physical RAM total kBytes. 'VMEM USED' Returns the virtual memory used kBytes. 'VMEM FREE' Returns the virtual memory free kBytes. 'VMEM TOTAL' Returns the virtual memory total kBytes. |
| Example |
|---|
| total ulong code total = ds_Memory() ! Returns the virtual memory used by this application in Kilobytes |
| Parameter | Description |
|---|---|
| hKey (long) | The top level key containing the section of the registry to read. Valid values
are; WE::WM_HKEY_CLASSES_ROOT WE::WM_HKEY_CURRENT_USER WE::WM_HKEY_LOCAL_MACHINE WE::WM_HKEY_USERS |
| SubKeyPath (string) | The path inside the registry to the item you want to read. |
| ValueName (String) | The name of the variable you want to read. |
| Example |
|---|
| htmleditor string(255) code htmleditor = ds_GetReg(we::wm_hkey_current_user, | 'Software\Microsoft\Internet Explorer\Default HTML Editor','Description') |
| Parameter | Description |
|---|---|
| hKey (long) | The top level key containing the section of the registry to write. Valid values
are; WE::WM_HKEY_CLASSES_ROOT WE::WM_HKEY_CURRENT_USER WE::WM_HKEY_LOCAL_MACHINE WE::WM_HKEY_USERS |
| SubKeyPath (string) | The path inside the registry to the item you want to write. |
| ValueName (String) | The name of the variable you want to write. |
| Value (String) | The value you want to write into the registry. |
| Type (Long) | the type of the value you are writing. Valid values are; WE::REG_SZ !!// Unicode nul terminated string WE::REG_EXPAND_SZ !!// Unicode nul terminated string WE::REG_BINARY !!// Free form binary WE::REG_DWORD !!// 32-bit number WE::REG_DWORD_LITTLE_ENDIAN !!// 32-bit number (same as REG_DWORD) WE::REG_DWORD_BIG_ENDIAN !!// 32-bit number WE::REG_MULTI_SZ !!// Multiple Unicode strings Default value for this parameter is WE::REG_SZ. |
| Example |
|---|
|
htmleditor string(255) code htmlEditor = 'Microsoft Expression Web' ds_PutReg(we::wm_hkey_current_user, | 'Software\Microsoft\Internet Explorer\Default HTML Editor','Description',htmlEditor,we::reg_sz) |
| Parameter | Description |
|---|---|
| WavFileName (string) | The name of the Wav file on the disk, including path if necessary. |
| Example |
|---|
| code sound('alarm.wav') |
| Example |
|---|
| a string(255) code a = GetWindowsDir() |
| Example |
|---|
| a string(255) code a = GetSystemDir() |
| Example |
|---|
| a long code a = ScreenWidth() |
| Example |
|---|
| a long code a = ScreenHeight() |
| Example |
|---|
| a long code a = ScreenDepth() |
| Parameter | Description |
|---|---|
| pDPIY (optional) | Defaults to X DPI. If set to TRUE then returns Y DPI. These are usually the same. |
| Example |
|---|
|
a long code a = ds_GetScreenDPI() |
| Parameter | Description |
|---|---|
| UseCPUTimeStamp (byte) | Optional, Default = FALSE. If set then the ds_ReadCPUTimeStamp() function is used to return the time down to a resolution of the CPU clock. (1 GHz = 1ns resolution) |
| ReSyncTime (byte) | Optional, Default = FALSE. Use (once) when time has been adjusted and so ds_FastClock <> Clock(). |
| Example |
|---|
| ThisTime real code ThisTime - ds_FastClock() DisplayTime = ds_FormatFastTime(ThisTime,4) ! 16:23:31.0124 |
| Parameter | Description |
|---|---|
| pFastTime (real) | The time in 100 ths of a second (clarion time). |
| pDecimalPlaces (long) | Optional. The number of decimal places to display. |
| Example |
|---|
| code DisplayTime = ds_FormatFastTime(ds_FastClock(),4) ! 16:23:31.0124 |
| Parameter | Description |
|---|---|
| pFastTime (real) | The time in 100 ths of a second (clarion time) for which to sleep. |
| Example |
|---|
| code ds_Sleep(100.1) ! wait 1.001 seconds |
| Parameter | Description |
|---|---|
| pTimerNumber (long) | Used to specify multiple timers (per thread) |
| pFastTime (real) | The time in 100 ths of a second (clarion time). |
| Example |
|---|
|
code ds_Timer(1,100.1) ! init timer 1 to 1.001 seconds loop until ds_Timer(1) ! break when timer 1 elapses. ..... ds_Timer(1,50) ! Restart timer 1 at 0.5 seconds ..... end |
| Parameter | Description |
|---|---|
| pDate (long) | The date for which the week day is required. (Clarion date) |
| pShortFormatFlag (byte) | Optional. If TRUE(1) then the short name for the day is returned. "Wednesday" would return as "Wed" |
| Example |
|---|
|
code DisplayDay = ds_WeekDay(today()) ! Returns the current day of the week, i.e. "Wednesday" DisplayDay = ds_WeekDay(today(),1) ! Returns the current day of the week, i.e. "Wed" |
| Parameter | Description |
|---|---|
| pSaveREal (*real) | The 64 bit number returned by the CPU is saved into this real. Will overflow after 52 bits. (50 days at 1GHz) |
| Example |
|---|
|
ThisTime real code ds_ReadCPUTimeStamp(ThisTime) ! Save TimeStamp into real ...... ds_ReadCPUTimeStampDelta(ThisTime) ! CPU Cycles elapsed. |
| Parameter | Description |
|---|---|
| pSaveREal (*real) | The 64 bit number returned by the CPU is saved into this real. Will overflow after 52 bits. (50 days at 1GHz) |
| Example |
|---|
|
ThisTime real code ds_ReadCPUTimeStamp(ThisTime) ! Save TimeStamp into real ...... ds_ReadCPUTimeStampDelta(ThisTime) ! CPU Cycles elapsed. |
| Parameter | Description |
|---|---|
| pFileName (string) | Specify the file (with path) to delete. |
| Example |
|---|
| code ds_DeleteFile('c:\FileName.ext') |
| Parameter | Description |
|---|---|
| pFileName (string) | Specify the file (with path) for which the directory entry data is required. |
| pEntryG (*string) | Provide the label of an EntryG structure. See example below. |
| Example |
|---|
|
EntryG group,PRE(EntryG) name STRING(256) shortname string(13) date LONG time LONG size LONG attrib BYTE end code ds_GetFileDirEntry('c:\FileName.ext',EntryG) ! fills the EntryG with the files directory attributes. |
| Parameter | Description |
|---|---|
| pFileName (string) | Specify the file (with path) for which the directory entry data is required. |
| pNewFileAttribs (byte) | Specify the new attributes. ff_:NORMAL EQUATE(0) !Always active ff_:READONLY EQUATE(1) !Not for use as attributes parameter ff_:HIDDEN EQUATE(2) ff_:SYSTEM EQUATE(4) ff_:DIRECTORY EQUATE(10H) ff_:ARCHIVE EQUATE(20H) ! NOT Win95 compatible |
| Example |
|---|
| code ds_SetFileAttributes('c:\FileName.ext',0) ! clears files attributes. |
| Parameter | Description |
|---|---|
| Source (string) | The name of the source directory to copy from. |
| Destination (string) | The name of the destination directory to copy to. If the destination directory does not exist it will be created. |
| Mask (string) | The mask for files in the source folder(s) to copy. For example *.htm will copy only files with the htm extension. If this parameter is left blank then the default mask, *.*, will be used. |
| IncludeSubDirectories (long) | Set to 1 for sub-directories to be copied as well. Set to 0 if only files must be copied. This parameter is option, the default value is 0 (ie by default sub-directories are not copied.) |
| IncludeHiddenFiles (long) | This parameter is optional, the default value is 1. If you do not want to copy hidden files then set this parameter to 0. |
| IncludeSystemFiles (long) | This parameter is optional, the default value is 1. If you do not want to copy system files then set this parameter to 0. |
| ProgressControl (long) | The Use Equate number of a progress control on the window. If this is set then the progress bar will be updated as the Copy command progresses. If it is set to 0 or omitted then no progress control will be updated. |
| StringControl (long) | The Use Equate number of a string control on the window that will be updated with the name of the file currently being copied. If set to 0, or omitted, then no string control will be updated. |
| Example |
|---|
| code ans = ds_CopyDirectory(FileSelected,CopyTo,'*.*',1,1,1,?Progress1,?String1) |
| Parameter | Description |
|---|---|
| pNewDirectoryName (string) | Specify the name (including path) of the new directory to create. |
| Example |
|---|
| code ds_CreateDirectory('c:\My New Directory') ! creates the directory |
| Parameter | Description |
|---|---|
| pDirectoryName (string) | Specify the name (including path) of the directory to remove. |
| Example |
|---|
| code ds_RemoveDirectory('c:\My New Directory') ! removes any empty directory. |
| Parameter | Description |
|---|---|
| pFileName (string) | Specify the file (with path) for which the directory is to be modified. |
| pNewDate (long) | New date (clarion date) for the file. |
| pNewTime (long) | New time (clarion time) for the file. |
| Example |
|---|
| code ds_SetFileDateTime('c:\MyFile.txt',today(),clock()) ! Sets the files date and time to now. |
| Parameter | Description |
|---|---|
| pFileName (string) | Specify the file (with path) to be moved. |
| pNewFileName (string) | Specify the new file (with new path). |
| Example |
|---|
| code ds_MoveFile('c:\MyFile.txt','c:\NewDirectory\NewFileName.ext') ! moves and renames the file to the directory. |
| Parameter | Description |
|---|---|
| pCSIDL (long) | A CSIDL equate specifying the windows folder. |
| pCreateFlag (byte) | Optional. If TRUE (1) then the folder will be created if it does not exist. |
| Example |
|---|
| code DisplayPath = ds_GetFolderPath(WE::CSIDL_PROGRAMS,1) ! C:\Documents and Settings\username\Start Menu\Programs DisplayLongPath = longpath(DisplayPath) |
| Example |
|---|
| code DisplayPath = ds_GetTempPath() ! C:\WINDOWS\TMP |
| Parameter | Description |
|---|---|
| pWriteString (string) | String to be written to file. |
| pWriteLen (long) | Optional. The length of the string to be written to file. If omitted then the string is clipped before writing to file. |
| pFileName (string) | The name of the file (including path). |
| Example |
|---|
| code if ds_String2File('Just Testing',,'C:\MyTestFile.TXT') ! Creates / empties file and then writes data to file. message('ds_string2file failed : ' & ds_error()) end |
| Parameter | Description |
|---|---|
| pStringRef (ds_StringRef) | The label of a ds_StringRef structure. |
| pMaxLen (long) | Optional. The max length of the string to be returned. File contents truncated at this length if required. |
| pFileName (string) | The name of the file (including path). |
| Example |
|---|
| TestFileRead GROUP(ds_StringRef) END code if ds_string2file('testing 123...',,'c:\testing.txt') message('ds_string2file failed : ' & ds_error()) end if ds_file2string(TestFileRead,,'c:\testing.txt') message('ds_file2string failed : ' & ds_error()) !No need to dispose if it failed else DisplayString = TestFileRead.bin ! string read from file. DisplayLength = TestFileRead.len ! Length of string read from file. dispose(TestFileRead.bin) end |
| Parameter | Description |
|---|---|
| pModuleName (string) | Optional string containing the name of the required module. |
| Example |
|---|
| hModule ulong code hModule = ds_GetHModule() ! returns handle to current module. hModule = ds_GetHModule('MyIcons.dll') ! returns handle to MyIcons.dll |
| Parameter | Description |
|---|---|
| pIconName (string) | The name of the icon file or icon resource. Compiled-in icon names must be prefixed with '~'. |
| pHIconModule (ulong) | Optional. A handle to the module containing the icon. |
| pIconSize (long) | Optional. The size required. Usually 16X16, 32X32 or 48X48. Defaults to 16X16 if it exists. |
| Example |
|---|
|
hIcon ulong code hIcon = ds_GetHIcon('~MyIcon.ico') ! returns handle to compiled-in icon called 'MyIcon.ico'. hIcon = ds_GetHIcon('~MyIcon.ico',ds_GetHModule('MyIcons.dll') ! returns handle to 'MyIcon.ico' in the DLL MyIcons.dll hIcon = ds_GetHIcon('MyIcon.ico',,48) ! returns handle to 48X48 icon inside the file 'MyIcon.ico'. ...... ds_DestroyIcon(hIcon) ! Free memory |
| Parameter | Description |
|---|---|
| pTargetFile (string) | The file, including the path, to which a
shortcut must be made. Example C:\WINDOWS\SYSTEM32\CALC.EXE |
| pIconName (<string>) | The file, including the path, which contains the icon to be used with this shortcut. If omitted then the first icon in the pTargetFile is used. |
| pIconIndex (long) | The index of the icon within the pIconName file to use. If omitted then the first icon is used. |
| pDescription (string) | The tip which will appear if the cursor is held over the shortcut. |
| pHotKey (long) | The hot key to run the shortcut. Omit or
use ZERO if not required. Example CTRLALTC |
| pStartIn (string) | The path to the directory in which the file must be run / opened. |
| pShortCut (string) | The name for the shortcut. Example 'Calculator.LNK' |
| pShortCutPath (<string >) | The destination where the shortcut
must be placed. If omitted then defaults to the desktop. Example C:\Documents and Settings\Derek\Desktop |
| pArguments (<string>) | if you would like to add arguments (i.e. command line parameters) to the shortcut command line, then you can pass these in this parameter. |
| pReserved (<string>) | reserved for future functionality. |
| Example |
|---|
|
code ds_CreateShortcutEx(clip(ds_GetFolderPath(WE::CSIDL_SYSTEM ,1)) & '\CALC.EXE',,,'Calculator!',CTRLALTC,clip(ds_GetFolderPath(WE::CSIDL_SYSTEM ,1)),'Calculator.LNK') ds_CreateShortcutEx('C:\WINDOWS\SYSTEM32\CALC.EXE',,,'Calculator!',CTRLALTC,'C:\WINDOWS\SYSTEM32','Calculator.LNK','C:\Documents and Settings\Derek\Desktop','/debugfmall') ds_RefreshDesktop() |
| Parameter | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pDescription (string) | Default='FileVersion' The name version
data required. Standard descriptions are as follows:
| ||||||||||||
| pFileName (*string) | Default=Current Module. The name including path of the file from which version data is required. |
| Example |
|---|
| code DisplayInfo = ds_GetFileVersionInfo() ! returns FileVersion by default. |
| Example |
|---|
| code CurrentEXEDate = ds_GetCurrentEXEDate() ! returns the EXE date by default. |
| Parameter | Description |
|---|---|
| pProcName (string) | The name of the DLL procedure. This procedures call address will be returned. |
| pLibName (string) | The name of the DLL to load. |
| pProcAddress (ulong) | The call address of the DLL procedure is saved here. Subsequent calls to ds_LoadDLLProc will simply return if this is already set. |
| pLibInstance (ulong) | Optional. This is used by ds_UnloadDLLProc to unload the DLL if it is no longer required. |
| Example |
|---|
| "Inside global map" - Global embed point module('windows') WC_GetDiskFreeSpaceEx(ulong,*dlong,*dlong,*dlong), byte, raw, pascal, Dll(_fp_) ! The Dll(_fp_) tells the compiler not to link in this function. end "Global Data" - Global embed point fp_GetDiskFreeSpaceEx ulong,static,name('WC_GetDiskFreeSpaceEx') code if ~ds_LoadDLLProc('GetDiskFreeSpaceExA','kernel32',fp_GetDiskFreeSpaceEx) result = WC_GetDiskFreeSpaceEx(0,dlongUserFree,dlongTotal,dlongTotalFree) ... else ! lib or function not found message('ds_LoadDLLProc failed : ' & ds_Error()) end |
| Parameter | Description |
|---|---|
| pProcAddress (ulong) | The call address of the DLL procedure will be reset. This will force a subsequent call to ds_LoadDLLProc to reload the DLL. |
| pLibInstance (ulong) | This must be set by ds_LoadDLLProc. |
| Example |
|---|
| "Inside global map" - Global embed point module('windows') WC_GetDiskFreeSpaceEx(ulong,*dlong,*dlong,*dlong), byte, raw, pascal, Dll(_fp_) ! The Dll(_fp_) tells the compiler not to link in this function. end "Global Data" - Global embed point fp_GetDiskFreeSpaceEx ulong,static,name('WC_GetDiskFreeSpaceEx') LibInstance ulong,static code if ~ds_LoadDLLProc('GetDiskFreeSpaceExA','kernel32',fp_GetDiskFreeSpaceEx,LibInstance) result = WC_GetDiskFreeSpaceEx(0,dlongUserFree,dlongTotal,dlongTotalFree) ... else ! lib or function not found message('ds_LoadDLLProc failed : ' & ds_Error()) end ..... if ds_UnloadDLLProc(fp_GetDiskFreeSpaceEx,LibInstance) ! Unload DLL as no longer required message('ds_UnloadDLLProc failed : ' & ds_Error()) end |
| Parameter | Description |
|---|---|
| pDLLName (string) | The name of the DLL from which version info is required. |
| pDLLVerInf (*ds_DLLVersionG) | This structure is filled with the version info. |
| Example |
|---|
| DLLVerInf group(ds_DLLVersionG) . code if ~ds_GetDLLVersion('shell32.dll',DLLVerInf) ! ds_DLLVersionG group ! MajorVersion ulong ! MinorVersion ulong ! BuildNumber ulong ! PlatformID ulong ! String string(30) ! end if DLLVerInf.MajorVersion > 4 ! Taskbar balloons supported under shell version 5 and higher. else ! Taskbar balloons not supported. end end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSMSText (string) | The SMS text string to send. Example 'Please call me. I am low on airtime :)' |
| pSMSPhoneNumber (string) | The mobile number to send the SMS to. |
| pPIN (string) | Optional. The PIN number to gain access to the
SIM card in the GSM modem. The PIN code request on the SIM card may be disabled. In this case the PIN is not required. NB : If you try the wrong PIN code 3 times then your SIM may be locked and will need the PUK number to unlock it. This is not handled by WinEvent. |
| pSMSID (*long) | Optional. Most GSM modems return an SMS identifier that may be used with the SMS delivery report to identify which SMS was delivered. |
| Example |
|---|
|
PID long SMSID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMSendSMS(PID,'Hello There','08XXXXXXXXX','1234',SMSID) message = ds_Error() else message = 'Send Succeeded, SMSID=' & SMSID1 end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pPIN (string) | The PIN number to gain access to the SIM card in the GSM modem. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMEchoOFF(PID) message('ds_GSMEchoOFF failed : ' & ds_Error()) elsif ds_GSMEnterPIN(PID,PIN) message('ds_GSMEnterPIN failed : ' & ds_Error()) else message('PIN OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMEchoOFF(PID) message('ds_GSMEchoOFF failed : ' & ds_Error()) else message('ECHO OFF') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMEchoOFF(PID) message('ds_GSMEchoOFF failed : ' & ds_Error()) elsif ds_GSMSetSMSTextmode(PID) message('ds_GSMSetSMSTextmode failed : ' & ds_Error()) else message('ds_GSMSetSMSTextmode OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pCMD (string) | The command to send to the modem.
Tip : Most modems require a CR / LF terminator on the command ie. 'AT+CPIN?<13,10>' where ascii 13 is CR and ascii 10 is LF. |
| pCmdLen (long) | Optional. This is the command string length to send. If omitted then the string is clipped before sending. |
| pReplyString (*string) | The modem response is returned in this string. |
| pTimeout (long) | Optional. Default =50 (0.50 secs). This is the timeout for the first character of the modem response. You might need to increase this to quite large (depending on the service provider). Some Providers require as much as 90 seconds (i.e. this timeout set to 9000). If you are getting intermittent or failed replies, then this is one possibility that should be adjusted. |
| pTimeout2 (long) | Optional. Default =25 (0.25 secs). This is the timeout for subsequent characters of the modem response. |
| pTrailingOK (byte) | Optional. Default=FALSE. This
flag when set specifies that the modem response terminates with an
'<13,10>OK<13,10>' . If not set then the first '<13,10>' will be taken as the end of the modem response. |
| pFindPrompt (byte) | Optional. Default=FALSE. This flag when set specifies that the modem response terminates with an '> ' . |
| pIgnorePrompt (byte) | Optional. Default=FALSE. This flag when set then leading '> ' characters in the modem response are discarded. |
| Example |
|---|
|
PID long ReplyString string(1024) code PID = NewPort('com1:9600,n,8,1') ds_GetGSMReply(PID,'AT+CPIN?<13,10>',,ReplyString,,,1) ! Query +CPIN state and waits for OK response. ds_GetGSMReply(PID,'AT+CMGS="082XXXXXX"<13,10>',,ReplyString,1000,,,1) ! Dials Mobile Number and waits for "> " response. |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pTimeout (long) | Optional. Default =50 (0.5 secs). This is the timeout for attempting to empty the com port input buffer. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_ds_EmptyPort(PID) message('ds_EmptyPort failed : ' & ds_Error()) else message('ds_EmptyPort OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pPIN (string) | Optional. The PIN number to gain access to the SIM card in the GSM modem. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMReadSMSInit(PID) message('ds_GSMReadSMSInit failed : ' & ds_Error()) else message('ds_GSMReadSMSInit OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSMSIndex (long) | Which memory index to read. |
| pSMSG (*ds_SMSMessageG) | This structure is filled with the data from the memory index. |
| Example |
|---|
| PID long SMSIndex long SMSG group(ds_SMSMessageG) end code SMSIndex = 0 PID = NewPort('com1:9600,n,8,1') if ds_GSMReadSMSInit(PID,PIN) message('ds_GSMReadSMSInit failed : ' & ds_Error()) else loop SMSIndex += 1 if ds_GSMReadSMS(PID,SMSIndex,SMSG) then break . ! SMSIndex ! ds_SMSMessageG group,type ! Type string(20) ! MobileNumber string(50) ! Date long ! Time long ! TimeZone long ! Text string(255) ! end end end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSMSIndex (long) | Which memory index to clear. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMDeleteSMS(PID,3) ! delete index 3 message('ds_GSMDeleteSMS failed : ' & ds_Error()) else message('ds_GSMDeleteSMS OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pEnableReport (byte) | Optional. Default=1 (TRUE) If this flag is reset (0) then the SMS delivery reporting is disabled. |
| pTimeout (long) | Optional. Default =1440 minutes (24
Hours). This is the length of time in minutes that the network must
try to send the SMS for before sending a failed report. The range of the timeout is from 5 minutes to 63 weeks. if pTimeOut > 43200 ! 30 days the resolution is weeks [5 to 63 weeks] elsif pTimeOut > 1440 ! 1 day the resolution is days [2 to 30 days] elsif pTimeOut > 720 ! 12 hours the resolution is 30 minute blocks [12:30 to 24:00] else ! <= 12 hours the resolution is 5 minute blocks [0:05 to 12:00] end |
| pPIN (string) | Optional. The PIN number to gain access to the SIM card in the GSM modem. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMSetSMSReporting(PID) message('ds_GSMSetSMSReporting failed : ' & ds_Error()) else message('ds_GSMSetSMSReporting OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSRMemory (byte) | Optional. Default=1 (TRUE) If this flag is set
then the SMS delivery report storage area is selected. If this flag is reset then the received SMS storage area is selected. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMSelectSR(PID) message('ds_GSMSelectSR failed : ' & ds_Error()) else message('ds_GSMSelectSR OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pPIN (string) | Optional. The PIN number to gain access to the SIM
card in the GSM modem. The PIN code request on the SIM card may be disabled. In this case the PIN is not required. NB : If you try the wrong PIN code 3 times then your SIM may be locked and will need the PUK number to unlock it. This is not handled by WinEvent. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMReadSMSReportInit(PID) message('ds_GSMReadSMSReportInit failed : ' & ds_Error()) else message('ds_GSMReadSMSReportInit OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSMSReportIndex (long) | Which memory index to read. |
| pDRG (*ds_SMSReportG) | This structure is filled with the data from the memory index. |
| Example |
|---|
| PID long SMSReportIndex long DRG group(ds_SMSReportG) end code SMSReportIndex = 0 PID = NewPort('com1:9600,n,8,1') if ds_GSMReadSMSReportInit(PID,PIN) message('ds_GSMReadSMSReportInit failed : ' & ds_Error()) else loop SMSReportIndex += 1 if ds_GSMReadSMSReport(PID,SMSReportIndex,DRG) then break . ! SMSReportIndex ! ds_SMSReportG group,type ! Type string(20) ! SMSID long ! MobileNumber string(50) ! SentDate long ! SentTime long ! SentTimeZone long ! DeliveredDate long ! DeliveredTime long ! DeliveredTimeZone long ! StatusCode long ! Status string(20) ! end end end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pSMSReportIndex (long) | Which memory index to clear. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMDeleteSMSReport(PID,3) ! delete index 3 message('ds_GSMDeleteSMSReport failed : ' & ds_Error()) else message('ds_GSMDeleteSMSReport OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pERG (*ds_GSMEventG) | This structure is filled with any event data found. |
| Example |
|---|
| PID long ERG group(ds_GSMEventG) end code PID = NewPort('com1:9600,n,8,1') if ds_GSMReadEvents(PID,ERG) message('GSMReadEvents failed : ' & ds_Error()) else ! ds_GSMEventG group,type ! Date long ! Time long ! Text string(255) ! Type string(3) ! Index long ! end end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| pEventsMask (long) | Optional. Default=255. This long selects which events are enabled. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMSetEvents(PID) message('ds_GSMSetEvents failed : ' & ds_Error()) else message('ds_GSMSetEvents OK') end |
| Parameter | Description |
|---|---|
| pPID (long) | This is the PortID of the open com port to which the GSM modem is connected. See the NewPort function. |
| Example |
|---|
| PID long code PID = NewPort('com1:9600,n,8,1') if ds_GSMReset(PID) message('ds_GSMReset failed : ' & ds_Error()) else message('ds_GSMReset OK') end |
| Parameter | Description |
|---|---|
| pDebugString (string) | Debug info string. |
| pAddCRLF (byte) | Add carriage return and line feed to the debugstring if set. |
| Example |
|---|
| code ds_OutputDebugString('Test to debug - view in something like DebugViewer from SysInternals) |
| Parameter | Description |
|---|---|
| pDebugString (string) | Debug info string. |
| pWindowLabel (string) | Optional. This label identifies which procedure is sending the debug info. The thread number is added to the end of this string. |
| pEventNumber (long) | Optional. Used by the template in order to display the window events. |
| pFieldNumber (long) | Optional. Used by the template to display which control received the event. |
| Example |
|---|
| code ds_ViewDebug ! opens the debug viewer. ds_Debug('Just testing') ! sends "Just Testing" to the windows debug viewer. |
| Parameter | Description |
|---|---|
| pEnable (byte) | If TRUE (1) then WinEvent internal debugging info is sent to the debug viewer. If FALSE (0) then WinEvent internal debugging info is suppressed. |
| Example |
|---|
| fp_Testing ulong code ds_WineventDebug(1) ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. Debug string ! ds_LoadDLLProc error, LoadLibrary failed DLL=NoneExistant.dll The specified module could not be found. |
| Example |
|---|
| fp_Testing ulong code ds_ViewDebug ! open debug viewer. ds_WineventDebug(1) ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. Debug string ! ds_LoadDLLProc error, LoadLibrary failed DLL=NoneExistant.dll The specified module could not be found. |
| Example |
|---|
| fp_Testing ulong code ds_DebugView ! open debug viewer. ds_WineventDebug(1) ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. Debug string ! ds_LoadDLLProc error, LoadLibrary failed DLL=NoneExistant.dll The specified module could not be found. ds_DebugViewClose ! close the debug viewer. |
| Parameter | Description |
|---|---|
| pThisErrorCode (long) | Optional. If omitted then the current ds_ErrorCode() is used. This is the error code for which the text error message is required. |
| Example |
|---|
|
fp_Testing ulong code if ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. message('Error ' & ds_error()) end |
| Example |
|---|
| fp_Testing ulong SaveErrorCode long code if ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. SaveErrorCode = ds_ErrorCode() message('Error ' & ds_error()) end |
| Parameter | Description |
|---|---|
| pCallingProcedure (string) | Optional. This procedure name will be returned with any ds_Error() message string. Useful for identifying the parent procedure where a procedure is called from various procedures. |
| Example |
|---|
| fp_Testing ulong SaveErrorCode long code if ds_LoadDLLProc('Testing','NoneExistant.dll',fp_Testing) ! Attempt to locate a procedure in an non-existant dll. SaveErrorCode = ds_ErrorCode() message('Error ' & ds_error()) end |
| Example |
|---|
| code ds_SaveStack ! some external procedure call. ds_TestStack |
| Parameter | Description |
|---|---|
| pDisplayValue (ulong) | The number to format as hex. |
| pPadSpaces (byte) | The length of the hex number to return (leading zeros). |
| Example |
|---|
| DisplayHex string(10) code DisplayHex = ds_FormatHex(31,4) ! 001F |
| Parameter | Description |
|---|---|
| pClipFormat (ulong) | The format specifier. |
| pNewContents (string) | The data to be placed in the clipboard. |
| pClipFormat Value | pNewContents requires: |
| WE::CF_BITMAP | a handle to a bitmap memory space. |
| WE::CF_DIB | a memory object containing a BITMAPINFO structure followed by the bitmap bits. DIB = Device-Independant Bitmap |
| WE::CF_DIBV5 | a memory object containing a BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits. |
| WE::CF_DIF | |
| WE::CF_ENHMETAFILE | a handle to an enhanced metafile (HENHMETAFILE). |
| WE::CF_HDROP | a handle to type HDROP that identifies a list of files. (see example below) |
| WE::CF_LOCALE | |
| WE::CF_METAFILEPICT | a handle to a metafile picture format as defined by the METAFILEPICT structure. |
| WE::CF_OEMTEXT | a Text format string. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
| WE::CF_PALETTE | |
| WE::CF_PENDATA | |
| WE::CF_RIFF | |
| WE::CF_SYLK | |
| WE::CF_TEXT | a Text format string. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
| WE::CF_TIFF | a Tagged-image file format. |
| WE::CF_UNICODETEXT | a Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
| WE::CF_WAVE | an audio data string in one of the standard wave formats, such as 11 kHz or 22 kHz Pulse Code Modulation (PCM). |
| Example |
|---|
|
data hDropStruct group pFiles long ! offset from here to FileList pt ulong ! drop point (in screen co-ords) blank ulong fNC long !Set for Non-Client area. fWide long FileList string(255) ! Null terminated list of null terminated file names. end code hDropStruct.filelist = 'C:\autoexec.bat<0,0>' ! List of files. Note the double null terminator. hDropStruct.pFiles = 20 hDropStruct.fWide = 0 ! ASCII if ~ds_SetClipboard(CF_hDrop,hDropStruct) ! Place name in clipboard. message('SetClipboardFailed') end |
| Parameter | Description |
|---|---|
| pForce (byte) | Optional. When set (1) then any processes that do not "respond" are terminated by windows. |
| Example |
|---|
| code ds_Shutdown() ! Request a windows shutdown. |
| Example |
|---|
| code if ds_WinEventVersion < 3.21 message('Error old WinEvent DLL in use') end |
| Parameter | Description |
|---|---|
| pUlongHigh (long) | The first 4 bytes of the ulong64. |
| pUlongLow (long) | The last 4 bytes of the ulong64. |
| Example |
|---|
| RealVar
real ulong64G group High long Low long end code RealVar = ds_Ulong64toReal(ulong64G:High,ulong64G:Low) |
| Parameter | Description |
|---|---|
| pCallBackAddress (ulong) | The address of the OKToEndSessionHandler. |
| Example |
|---|
| OldHandlerAddress ulong code OldHandlerAddress = ds_SetOKToEndSessionHandler(address(MyOKToEndSessionHandler)) |
| Parameter | Description |
|---|---|
| pCallBackAddress (ulong) | The address of the EndSessionHandler. The EndSessionHandler must be prototyped as : EndSessionHandler(long pLogoff),long,pascal |
| Example |
|---|
| OldHandlerAddress ulong code OldHandlerAddress = ds_SetEndSessionHandler(address(MyEndSessionHandler)) |
| Parameter | Description |
|---|---|
| pNoEndSession (long) | When set (1) then the Auto-Shutdown is disabled. |
| Example |
|---|
| code ds_SetNoEndSession(TRUE) ! Do backup routine here ds_SetNoEndSession(FALSE) |
| Example |
|---|
| long hProcess code hProcess = ds_GetCurrentProcess() |
| Example |
|---|
| long hThread code hThread = ds_GetCurrentThread() |
| Parameter | Description |
|---|---|
| hProcess (long) | Optional. The windows handle to the process. Defaults to the current process. |
| IncludeFlags (long) | Optional. 1 = User Time, 2 = Kernal Time, 0 = Total Time (Default) |
| Example |
|---|
| real UserTime code UserTime = ds_GetProcessTime(,1) DisplayTime = ds_FormatFastTime(UserTime,6) ! HH:MM:SS.SSSSSS |
| Parameter | Description |
|---|---|
| hThread (long) | Optional. The windows handle to the thread. Defaults to the current thread. |
| IncludeFlags (long) | Optional. 1 = User Time, 2 = Kernal Time, 0 = Total Time (Default) |
| Example |
|---|
| real UserTime code UserTime = ds_GetThreadTime(,1) DisplayTime = ds_FormatFastTime(UserTime,6) ! HH:MM:SS.SSSSSS |
| Parameter | Description |
|---|---|
| hProcess (long) | Optional. The windows handle to the process. Defaults to the current process. |
| hThread (long) | Optional. The windows handle to the thread. Defaults to the current thread. |
| RealTimeFlag (byte) | Optional. When set (Default) then Real Time Priority is selected. When clear then Normal Priority is selected. |
| Example |
|---|
| code ds_SetRealTimePriority(,,TRUE) ! Select Real Time priority ...... ds_SetRealTimePriority(,,FALSE) ! Select Nornal priority |

