Simplicty and flexibility!


Knowledge::CDF

REFERENCE FOR DEMACRO.DLL
KeyMacro( FileName )
KeyStrokes( KeyString )
Keymacro( "import.mac" )
KeyStrokes( "_f3" )


This CDF will automatically send a series of keystrokes stored in a command file to DataEase for immediate execution. The keystrokes are entered into an ASCII text file of your choice using a normal ASCII text editor. The keystrokes sent can be Function Keys, Alt or Ctrl key combinations, Cursor movement keys and most typing characters from the keyboard. Conventions for building this file are explained below. Once built, the command file can be called as part of a CDF passing arguement assigned to an Action Button or Image placed on a Form or Live report.

Note:

The Windows System Queue defaults to 120 events. Every keystroke is two events (KEYDOWN and KEYUP). This means that any single demacro script can contain only about 60 keystrokes. Characters can be two or more keystrokes. For example "a" is two keystrokes, "A" is four keystrokes, and "Ç" is ten keystrokes! (it gets sent as alt-0199). There is a way around this limitation. You can increase the size of the Windows System Queue with the undocumented command:

TypeAhead = xxxx

Where xxxx is an integer value. This command should be put in your WIN.INI file in the [windows] group.

Parameters


1. Filename: an ASCII text file containing the set of keystrokes to automatically execute.

2. KeyString: an ASCII text string containing the set of keystrokes to automatically execute.

Returns/Result


Examples


COMMAND FILE KEYSTROKE CONVENTIONS:

To send text keystrokes, simply type them into the file. For instance, to send PRICES.DAT, just type it into the file. No quotes or special characters are needed. Spaces are allowed anywhere in the text you type but are ignored (collapsed) when passed to DataEase. So, the string: "Jeremiah Johnson" would be sent to DataEase as “JeremiahJohnson". To embed hard spaces you must use the token "_sp". Therefore: "Jeremiah_sp Johnson" would be sent as "Jeremiah Johnson". Blank lines in the command file are also ignored. Comment lines can be added if they begin with the string "/*" and end with the string "*/. Failure to close a comment line with "*/" will cause an error when the CDF is fired. To send a combination of keystrokes such as ALT-PRTSC (to copy a picture of the current window to the Clipboard), you embed the second command within parentheses such as: _alt(_prtsc). When sending an Accelerator Key combination, make sure to put the text character in lower case. So to invoke FILE-OPEN you would enter the command _ctrl(o)

If you want to use a Button to automatically enter text into a field you must be sure to TAB back into or forward into the target field. So if you have a button that will write the text "Federal Express" into the DELIVERY field which is 2 tab order positions behind the button, you must precede the text string with two _shift(_tab) commands.

Once the command file is defined, you can call it via the DEMACRO CDF from a button. The Button Action should be set to EXPRESSION(CDF) and the Parameter box should have the following:

DEMARCO("path\command-filename").

TOKEN TABLE:

_SHIFT = SHIFT KEY key,

_CTRL = CONTROL key,

_ALT = ALT key,

_bksp = BACK SPACE key,

_break = BREAK key,

_caps = CAPS LOCK TOGGLE key,

_del = DELETE key,

_down = DOWN ARROW key,

_end = END key,

_enter = RETURN key,

_esc = ESCAPE key,

_home = HOME key,

_ins = INSERT TOGGLE key,

_left = LEFT ARROW key,

_pgdn = PGDN KEY key,

_pgup = PGUP KEY key,

_prtsc = PRINT SCREEN key,

_right = RIGHT ARROW key,

_tab = TAB key,

_up = UP ARROW key,

_sp = SPACE key,

_under = UNDERSCORE key,

_lpar = LEFT PAREN key,

_rpar = RIGHT PAREN key,

_scroll = SCROLL LOCK key,

_numlock = NUMLOCK key,

_F1 = F1 key,

_F2 = F2 key,

_F3 = F3 key,

_F4 = F4 key,

_F5 = F5 key,

_F6 = F6 key,

_F7 = F7 key,

_F8 = F8 key,

_F9 = F9 key,

_F10 = F10 key,

_F11 = F11 key,

_F12 = F12 key,

SCENARIO:

We have a Form into which we will Import data regularly using a standard file name. We wish to automate this process by pressing a button on the Form. The macro should bring up the IMPORT dialog, select VARIABLE Length Text as the file format, Tab to the Source Filename edit control, type in the text: "PRICES.DAT", and press the <enter> key to execute the import.

INSTALLATION OF DEMACRO.DLL AS A DataEase CDF:

Open the application within which you wish to integrate the function. From the Menu Bar, select APPLICATION - CUSTOM FUNCTIONS. Fill in the form as shown below and press F2 for each function (both functions are contained in the same DLL).

Function Name: KeyMacro

OS Type: WINDOWS

Description: Keystrokes read from a file

CDF Library Name: DEMACRO.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: FILENAME

Parm 1 Type: STRING

Function Name: KeyStrokes

OS Type: WINDOWS

Description: Keystrokes read from a string

CDF Library Name: DEMACRO.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: KeyString

Parm 1 Type: STRING

REFERENCE FOR DIALPHON.CDF

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

DIALPHONE ( Phone#, Port, Speaker, Volume, Direct )

PASSING ARGUMENTS:

1. Phone Number (string)

A character string consisting of a phone number and any

other valid modem commands.

2. Com Port Number (integer = 1, 2, 3, or 4)

The communications port to which your modem is connected.

3. Speaker Control (integer)

1 = Off

2 = On

3 = Off when dialing, then On.

4. Speaker Volume (integer)

1 = Low

2 = Medium

3 = High

5. Direct Dial (integer)

1 = No, bring up Dialog for User control.

2 = Yes, dial direct without user intervention.

RETURN VALUE:

Integer

SCENARIO:

Sample CDF expression:

DialPhone("9,375-8076", 1, 2, 1, 2)

9,375-8076 = 9 to get outside line

, wait 1 second

375-8076 telephone number to dial

1 = select COM port 1

2 = select speaker ON

1 = select low volume

2 = select direct dial as soon as running CDF.

INSTALLATION OF DIALPHON.DLL AS A DataEase for Windows CDF:

1. Place DIALPHON.DLL in the application directory.

2. Place the auxiliary library file: BWCC.DLL, in the path such

as C:\WINDOWS.

3. Open the application that will contain the function. From the

Menu Bar, select APPLICATION - CUSTOM FUNCTIONS. Fill in the

form as shown below and press F2.

Function Name: DialPhone

OS Type: WINDOWS

Description:

CDF Library Name: DIALPHON.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: FILENAME

Parm 1 Type: CHAR

Parm 2 Name:

Parm 2 Type:

Parm 3 Name:

Parm 3 Type:

Parm 4 Type:

Parm 5 Name:

Parm 5 Type:

Parm 6 Name:

Parm 6 Type:

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

REFERENCE FOR FILE_CDF.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

FileExecCDF(ExecuteString, iWndMode, ixWndPos,

iyWndPos, ixWndSize, iyWndSize)

PURPOSE:

This CDF passes a string to the Windows WinExec function. The WinExec

function parses the string and executes the command and also passes

open mode to ShowWindow. If The drive, path, or execution filename are

invalid an error message will display.

PASSING ARGUMENTS:

1. ExecuteString:

A character string consisting of an execution file's drive, path,

and filename. The string may also include data file drive,

path, filename and any other parameters the user desires.

2. iWndMode:

An integer value used to specify how the application window will display.

0 - Normalized

1 - Maximized

2 - Minimized

3 - Normalized then postioned with ixWndPos and iyWndPos and also sized

with ixWndSize and iyWndSize

Note:

iWndMode set to 1 or 3 will not behave as expected with DOS applications.

PIF files control the ShowWindow mode for DOS applications and can only

be overridden with iWndMode 2.

3. ixWndPos:

Horizontal position of the upper left corner of the application window.

Units are in pixels and are relative to the screen. This parameter is

ignored if iWndMode is not equal to 3.

4. iyWndPos:

Vertical position of the upper left corner of the application window

Units are in pixels and are relative to the screen. This parameter is

ignored if iWndMode is not equal to 3.

5. ixWndSize:

Horizontal size of the application window. Units are in pixels and are

relative to the screen. This parameter is ignored if iWndMode is not

equal to 3.

6. iyWndSize:

Vertical size of the application window. Units are in pixels and are

relative to the screen. This parameter is ignored if iWndMode is not

equal to 3.

RETURN VALUES:

None

SCENARIO:

User has a table where each record keeps track of a document. The user wants to

be able to view and edit the particular document referenced by a record in the table.

The Form has the following objects:

Fields

ExecFile - Text:50

DataFile - Text:50

ExecParam - Text:10

CombinedString - Text:160, Virtual, Prevent Entry

Derivation for CombinedString field:

jointext(ExecFile, jointext(" ", jointext(DataFile,

jointext(" ", ExecParam))))

Button

Button Text - View File

Button Action - FileExecCDF(CombinedString, 3, 300, 300, 350, 250)

INSTALLATION OF FILE_CDF.DLL AS A DataEase for Windows CDF:

Open the application that will contain the function. From the Menu Bar,

select APPLICATION - CUSTOM FUNCTIONS. Fill in the form as shown below

and press F2 for each function (both functions are contained in the

same DLL).

Function Name: FileExecCDF

OS Type: WINDOWS

Description: Passes String to the Windows WinExec function

CDF Library Name: File_CDF.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: ExecuteString

Parm 1 Type: CHAR

Parm 2 Name: iWndMode

Parm 2 Type: INT

Parm 3 Name: ixWndPos

Parm 3 Type: INT

Parm 4 Name: iyWndPos

Parm 4 Type: INT

Parm 5 Name: ixWndSize

Parm 5 Type: INT

Parm 6 Name: iyWndSize

Parm 6 Type: INT

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

REFERENCE FOR FILEEXEC.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

FileExec( ExecuteString, iWndMode, ixWndPos,

iyWndPos, ixWndSize, iyWndSize)

PURPOSE:

This CDF passes a string to the Windows WinExec function. The WinExec

function parses the string and executes the command and also passes

open mode to ShowWindow. If The drive, path, or execution filename are

invalid an error message will display.

PASSING ARGUMENTS:

1. ExecuteString:

A character string consisting of an execution file's drive, path,

and filename. The string may also include data file drive,

path, filename and any other parameters the user desires.

2. iWndMode:

An integer value used to specify how the application window will display.

0 - Normalized

1 - Maximized

2 - Minimized

3 - Normalized then postioned with ixWndPos and iyWndPos and also sized

with ixWndSize and iyWndSize

Note:

iWndMode set to 1 or 3 will not behave as expected with DOS applications.

PIF files control the ShowWindow mode for DOS applications and can only

be overridden with iWndMode 2.

3. ixWndPos:

Horizontal position of the upper left corner of the application window.

Units are in pixels and are relative to the screen. This parameter is

ignored if iWndMode is not equal to 3.

4. iyWndPos:

Vertical position of the upper left corner of the application window

Units are in pixels and are relative to the screen. This parameter is

ignored if iWndMode is not equal to 3.

5. ixWndSize:

Horizontal size of the application window. Units are in pixels and are

relative to the screen. This parameter is ignored if iWndMode is not

equal to 3.

6. iyWndSize:

Vertical size of the application window. Units are in pixels and are

relative to the screen. This parameter is ignored if iWndMode is not

equal to 3.

RETURN VALUES:

None

SCENARIO:

User has a table where each record keeps track of a document. The user wants to

be able to view and edit the particular document referenced by a record in the table.

The Form has the following objects:

Fields

ExecFile - Text:50

DataFile - Text:50

ExecParam - Text:10

CombinedString - Text:160, Virtual, Prevent Entry

Derivation for CombinedString field:

jointext(ExecFile, jointext(" ", jointext(DataFile,

jointext(" ", ExecParam))))

Button

Button Text - View File

Button Action - FileExec(CombinedString, 3, 300, 300, 350, 250)

INSTALLATION OF FILEEXEC.DLL AS A DataEase for Windows CDF:

Open the application that will contain the function. From the Menu Bar,

select APPLICATION - CUSTOM FUNCTIONS. Fill in the form as shown below

and press F2 for each function (both functions are contained in the

same DLL).

Function Name: FileExec

OS Type: WINDOWS

Description: Passes String to the Windows WinExec function

CDF Library Name: FileExec.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: ExecuteString

Parm 1 Type: CHAR

Parm 2 Name: iWndMode

Parm 2 Type: INT

Parm 3 Name: ixWndPos

Parm 3 Type: INT

Parm 4 Name: iyWndPos

Parm 4 Type: INT

Parm 5 Name: ixWndSize

Parm 5 Type: INT

Parm 6 Name: iyWndSize

Parm 6 Type: INT

REFERENCE FOR MSGBOX.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

MESSAGE ( Message Text , Caption Text , Icon , Buttons , Beep )

PURPOSE:

Displays a custom Windows message box allowing the application

developer to specify a custom message, message box title, a message

icon, various button combinations for dispatching the dialog and an

audible beep. This function can be used alone or in conjunction with

other DataEase for Windows functions. The function returns an integer

value corresponding to the Users response in dispatching the dialog.

PASSING ARGUMENTS:

1. Message Text:

a text message the application developer wishes to display.

2. Caption Text:

a 50 character string used as the title for the message dialog.

3. Icon:

an integer value that specifies what type of icon to display in

the message box.

1 Information Icon ( i )

2 Exclamation Icon ( ! )

3 Stop ( Stop sign )

4 Question ( ? )

5 No icon

4. Buttons:

an integer value that specifies what combination of buttons to

be displayed in the message dialog for the user to use in

dispatching the dialog and sending return values back to the

function.

0 (default) OK

1 OK CANCEL

2 RETRY CANCEL

3 ABORT RETRY CANCEL

4 YES NO

5 YES NO CANCEL

5. Beep:

an integer values that specifies what type of audible beep to

generate according to a given system alert level. The sound for

each alert level is determined by an entry in the [sounds]

section of WIN.INI.

0 or 1 (default) no sound

2 System sound

3 Information sound

4 Exclamation sound

5 Stop sound

6 Question sound

7 OK sound

RETURN VALUES:

Each message dialog you display will include at least one push button

for the user to dispatch the dialog. When a button is pressed, the

Message function returns an integer value indicating that it received

a user response and DataEase will continue processing. The following

return values correspond to the available buttons for display:

1 ABORT

2 CANCEL

3 IGNORE

4 NO

5 OK

6 RETRY

7 YES

0 Out of Memory

TIP:

Since the function returns an integer value, it may be awkward when

using Message in field derivations. The following example

illustrates one way to use Message:

SCENARIO:

We have a form with a date field called DEPARTURE DATE, and we

want to display a message when the user enters a date that is

prior to today's date (e.g. it's difficult to leave when you

already have). However, if the user enters a date after Today's

date, we want to display a message that indicates on what day of

the week that date occurs.

Field: DEPARTURE DATE

Derivation Formula:

if ( DEPARTURE DATE < current date ,

if ( Message

( jointext ( "The date you entered: " ,

jointext ( DEPARTURE DATE , " is invalid. \n\t

Do you want today's date?" )

) ,

"Invalid Date Message" , 4, 4, 6 ) = 7 ,

if ( Message

( jointext ( "Your entry date will be replaced with

today's date: " , current date ) ,

"Enter Current Date", 1, 0, 3 ) = 5, current date ,

current date ) ,

if ( Message

("Your entry will be discarded and the field will be

left blank." ,

"Discard Entry Date" , 2, 6, 4 ) = 5 , blank, blank )

) ,

if ( Message

( jointext ( "The date you entered: " ,

jointext ( DEPARTURE DATE,

jointext ( " is a " ,

spellweekday ( weekday ( DEPARTURE DATE ) ) ) ) )

"Day of the Week", 4, 4, 6 ) = 5 ,

DEPARTURE DATE , DEPARTURE DATE ))

NOTE: the symbols /n/t on line 4 tell Windows to display a

<newline> and <tab>.

FUNCTION:

BEEP ( Beep )

PURPOSE:

Generates an audible sound from the PC's speaker.

PASSING ARGUMENTS:

1. Beep:

an integer values that specifies what type of audible beep to

generate according to a given system alert level. The sound for

each alert level is determined by an entry in the [sounds]

section of WIN.INI.

0 or 1 (default) no sound

2 System sound

3 Information sound

4 Exclamation sound

5 Stop sound

6 Question sound

7 OK sound

RETURN VALUE:

The return value means nothing and can be discarded or ignored.

INSTALLATION OF MSGBOX.DLL AS A DataEase for Windows CDF:

Open the application within which you wish to integrate the function.

From the Menu Bar, select APPLICATION - CUSTOM FUNCTIONS. Fill in the

form as shown below and press F2 for each function (both functions are

contained in the same DLL).

Function Name: MESSAGE

OS Type: WINDOWS

Description: DISPLAYS CUSTOM MESSAGE BOX

CDF Library Name: MSGBOX.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: TEXT MESSAGE

Parm 1 Type: STRING

Parm 2 Name: CAPTION TITLE

Parm 2 Type: STRING

Parm 3 Name: ICON DISPLAY

Parm 3 Type: INT

Parm 4 Name: BUTTON SELECTION

Parm 4 Type: INT

Parm 5 Name: BEEP SOUND

Parm 5 Type: INT

Parm 6 Name:

Parm 6 Type:

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

Function Name: BEEP

OS Type: WINDOWS

Description: MAKES AN AUDIBLE BEEP

CDF Library Name: MSGBOX.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: BEEP SELECTION

Parm 1 Type: INT

Parm 2 Name:

Parm 2 Type:

Parm 3 Name:

Parm 3 Type:

Parm 4 Name:

Parm 4 Type:

Parm 5 Name:

Parm 5 Type:

Parm 6 Name:

Parm 6 Type:

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

REFERENCE FOR OSFUNC.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

GENERAL:

This CDF DLL contains a number of functions for basic operating

system commands. All strings should be enclosed within double

quotes.

FUNCTIONS/USAGE:

MakeDir ( path/file name , messageflag )

This Function will create a Directory. Optionally, the OS

response can be displayed within a message window by specifying

"Y" or "N" as the messageflag.

Input : Dir path/name and "Y" or "N"

Return : NONE

RemoveDir ( path/file name , messageflag )

This Function will delete a Directory. Optionally, the OS response

can be displayed within a message window by specifying "Y" or "N" as

the messageflag.

Input : Dir path/name and "Y" or "N"

Return : NONE

SearchFileInPath ( path/file name , messageflag )

This Function will search for a file in the current Dir, if not

found it will search the directories in the PATH environment

statement. Optionally, the OS response can be displayed within

a message window by specifying "Y" or "N" as the messageflag.

Inputs: File name and/or path

Returns: if found, the file name and its path.

FreeDiskSpace ( drive letter, messageflag )

This Function will report the amount of free disk space remaining

on the specified drive. Optionally, the OS response can be

displayed within a message window by specifying "Y" or "N" as

the messageflag.

Input : Drive letter to check for disk space & "Y" or "N"

Return : Disk space left

IsFile ( path/file name, file attribute)

This Function will search for a file in the current Dir, if not

found it will search the directories in the path statement. It will

also search for files with non-standard attributes.

Input : File name and/or path

Attribute: 00 Normal file, no attributes

01 Read only attribute

02 Hidden file

04 System file

08 Volume label

10 Directory

20 Archive

Return : if found, "YES" will be returned else "NO".

GetCurrentDiskLetter ( messageflag )

This Function will get the current disk drive letter. Optionally,

the OS response can be displayed within a message window by

specifying "Y" or "N" as the messageflag.

Inputs: "Y" or "N"

Returns: Current disk drive letter.

GetSizeOf ( path/file specification, messageflag )

This Function will calculate the size of all files within a

directory, or a specified group of files (i.e.: c:\*.sys).

Optionally, the OS response can be displayed within a message

window by specifying "Y" or "N" as the messageflag.

Inputs: The full path of a directory , "Y" or "N"

Returns: size in bytes of the specified directory /files

GetCurrentDirName ( messageflag )

This Function get the current Directory Name. Optionally, the

OS response can be displayed within a message window by

specifying "Y" or "N" as the messageflag.

Inputs: "Y" or "N"

Returns: name of the current directory.

GetDateTimeOf ( path/file name, messageflag )

This Function will get the Date Time of a file. Optionally, the

OS response can be displayed within a message window by

specifying "Y" or "N" as the messageflag.

Inputs: The fully qualified path of a file and "Y" or "N"

Returns: Date Time

OSVersion ( messageflag )

This Function will get the Operating System Version.

Inputs: "Y" or "N"

Return : Operating System Version

CopyFile ( source filename, destination file name, messageflag )

This Function will copy a file.

Input : Source Path/File, Destination Path/File and "Y" or "N"

Return : NONE

RenameFile ( old file Path/File, new file name, messageflag )

This Function will rename a file .

Input : Source Path/File, Destination Path/File & "Y" or "N"

Return : NONE

ChangeDir ( new directory name )

This Function will change the current directory.

Input : Directory that you wish to change to

Return : NONE

INSTALLATION OF the STRING FUNCTIONS AS A DataEase CDF:

Open the Sample CDF application and on the Main menu, press

the button on the bottom of the screen labeled 'CDFs SYSTEM FORM'.

Press F3 until you find the function you want to use in your own

application. From the the menu bar select EDIT-COPY RECORD. Exit

the Sample CDF application and access your application. Open the

CDFs System Form and Paste the record. You may need to change the

CDF LIBRARY NAME field to make sure DataEase can find the DLL file.

REFERENCE FOR PLAYSND.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

PlaySound ( WaveFileString )

PURPOSE:

This CDF passes a string (wave file name, e.g. chimes.wav) to the

Windows SndPlaySound function. The Windows function then immediately

plays the wave file. Your Windows configuration must be set up with

an appropriate Speaker driver.

PASSING ARGUMENTS:

1. WaveFileString:

A character string consisting of a wave file's drive, path,

and filename.

RETURN VALUES:

None

SCENARIO:

User has a table where each record stores the name of a different

wave or sound file. The user wants to be able to play the sound for

any record by pushing a button on the record they chosen to hear.

The Form has the following objects:

Fields

Name of Sound - Text:25

Wave File - Text:25

Button

Button Text - Play Sound

Button Action - PlaySound(Wave File)

INSTALLATION OF PLAYSND.DLL AS A DataEase for Windows CDF:

Open the application that will contain the function. From the Menu Bar,

select APPLICATION - CUSTOM FUNCTIONS. Fill in the form as shown below

and press F2.

Function Name: PlaySound

OS Type: WINDOWS

Description: Calls Windows function to immediately play a sound.

CDF Library Name: PLAYSND.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: FILENAME

Parm 1 Type: CHAR

Parm 2 Name:

Parm 2 Type:

Parm 3 Name:

Parm 3 Type:

Parm 4 Type:

Parm 5 Name:

Parm 5 Type:

Parm 6 Name:

Parm 6 Type:

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

REFERENCE FOR PLAYVID.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

FUNCTION:

PlayVideo ( WaveFileString )

PURPOSE:

This CDF passes a string (Video file name, e.g. Windsurf.AVI) to the

Windows VidPlaySound function. The Windows function then immediately

plays the video file via the Media Player program. Your Windows

configuration must be set up with an appropriate Video driver.

PASSING ARGUMENTS:

1. VideoFileString:

A character string consisting of a Video file's drive, path,

and filename.

RETURN VALUES:

None

SCENARIO:

User has a table where each record stores the name of a different

video file. The user wants to be able to play the video for

any record by pushing a button on the screen.

The Form has the following objects:

Fields

Name of Video - Text:25

Video File - Text:25

Button

Button Text - Play Video

Button Action - PlayVideo(Video File)

INSTALLATION OF PLAYVID.DLL AS A DataEase for Windows CDF:

Open the application that will contain the function. From the Menu Bar,

select APPLICATION - CUSTOM FUNCTIONS. Fill in the form as shown below

and press F2.

Function Name: PlayVideo

OS Type: WINDOWS

Description: Calls Windows function to immediately play a Video.

CDF Library Name: PLAYVID.DLL

Return Type: INT

DOS Mem Req't:

DOS Entry Point:

Parm 1 Name: FILENAME

Parm 1 Type: CHAR

Parm 2 Name:

Parm 2 Type:

Parm 3 Name:

Parm 3 Type:

Parm 4 Type:

Parm 5 Name:

Parm 5 Type:

Parm 6 Name:

Parm 6 Type:

Parm 7 Name:

Parm 7 Type:

Parm 8 Name:

Parm 8 Type:

Parm 9 Name:

Parm 9 Type:

Parm 10 Name:

Parm 10 Type:

REFERENCE FOR STRFUNC.DLL

DISCLAIMER:

This CDF is provided for illustration purposes only of the uses

for a Custom Defined Function within DataEase for Windows. This

CDF is provided 'As is' with no warranty whatsoever, either

expressed or implied. DataEase International, Inc. does not

warrant the CDF to be error free, nor does it warrant the CDF to

meet your specific requirements. In addition, this CDF is not

approved for use, nor is it subject to Technical Support by

DataEase International, Inc.

GENERAL:

This CDF DLL contains a number of functions for manipulating

character strings. All strings should be enclosed within double

quotes.

FUNCTIONS/USAGE:

StripChar ( targetstring/field , <character(s) to strip> )

This Function will search a string for a specific charaters if

found they will be striped out.

Inputs : A string of characters or field and the char(s) to be

striped out

Return : A string with striped out char(s)

PadChar ( character string , number )

This Function will duplicate a chracter string a number of times.

Inputs: A string of characters and the number of times to duplicate

Returns: The duplicated string

PasteFromClip ()

This Function will paste data from the clipboard.

Inputs: NONE

Returns: Text from the clipboard.

CopyToClip ( character string or field )

This Function will copy text to the clipboard.

Input: The text to be copied.

Output: NONE

JoinStrings ( string1 , string2 , ... , string10 )

This Function will concatenates a series of strings together.

Input: you must enter 10 strings to be joined (use two sets of

double quotes for any of the 10 strings not being used)

Output: The Concatenated string.

Convert ( <input type>target )

This function will convert between characters and their ASCII

decimal equivalants. The <input type> is the letter 'c' for

character or 'n' for decimal. If the input type is c then the

return value is decimal. Likewise if the input type is n then

the return value is character.

Inputs: a character or decimal number preceded by its <input type>.

Returns: a character if the input was of type decimal or

a decimal number if the input type was of type character.

FileRead ( filename, no. of characters to read, start position, messageflag )

This function will read a string of characters from a file, starting

at a specified position within the file and continuing for a

specified number of characters. Optionally, the string can be

displayed within a message window by specifying "Y" or "N" as the

messageflag.

Input: The filename, The number of characters to be read, the

starting position, and message option.

Return: A string of characters.

FileWrite ( filename, start position, string to write or field, messageflag )

This function will write a string of characters to a file, the

user will specify the name of the target file, the starting

position within the file, and the string or field value to write.

Optionally, the string can be displayed within a message window

by specifying "Y" or "N" as the messageflag.

Input: The filename, the starting position of where the string

will be inserted.

Return: "Success" or "Failure".

INSTALLATION OF the STRING FUNCTIONS AS A DataEase CDF:

Open the Sample CDF application and on the Main menu, press the

button on the bottom of the screen labeled 'CDFs SYSTEM FORM'.

Press F3 until you find the function you want to use in your own

application. From the the menu bar select EDIT-COPY RECORD. Exit

the Sample CDF application and access your application. Open the

CDFs System Form and Paste the record. You may need to change the

CDF LIBRARY NAME field to make sure DataEase can find the DLL file.

--

-- If DFW was installed to a directory other than C:\DFW,

-- the CDFs installed in this application may not work.

-- This Procedure updates the LIBRARY NAME field in the CDFs System

-- Form so that DFW is points to the proper location to find the CDF DLLs.

--

Define Temp "InstPath" Text .

Assign Temp InstPath :=

FirstC( SearchFileInPath( "DFW.EXE", "N" ) , TextPos( SearchFileInPath( "DFW.EXE", "N" ) , "\DFW.EXE" ) ) .

--Message Jointext( "Directory is: ", InstPath ) Window.

--

Define Temp "CDFPath" Text 30 .

--

For System Custom Functions ;

Assign Temp CDFPath :=

Midc(

Library Name

,

( TextPos( Library Name , "\SAMPLES\CDF" ) + 1 )

,

Length( Library Name ) - TextPos( Library Name , "\SAMPLES\CDF" )

) .

Modify Records

Library Name := Jointext ( Temp InstPath , Temp CDFPath )

.

End

Reference

See Also


On the forum about REFERENCE FOR DEMACRO.DLL

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien.&nbsp;le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 è poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about REFERENCE FOR DEMACRO.DLL


dg3_HelpView