How can i read the Parameters from a Window in Runtime with CDK

forum.cdk (1998-2005) & forum.td.cdk (2005-2010)
Michael Göldi

How can i read the Parameters from a Window in Runtime with CDK

Post by Michael Göldi » 05 Dec 2002, 16:05

 Posted by:  Michael Göldi 

Hy NG

My Problem:

I want read the Parameter's from a Window in Runtime with CDK.

Any Ideas or example for me

thanks

mg

bm

Re: How can i read the Parameters from a Window in Runtime with CDK

Post by bm » 06 Dec 2002, 10:50

 Posted by:  bm 

You can only get the datatype of the variable's at runtime.
But you can't get the name of the var and whether it's an array.
Is this, what you are looking for ?

--

Michael Göldi

Re: How can i read the Parameters from a Window in Runtime with CDK

Post by Michael Göldi » 06 Dec 2002, 13:12

 Posted by:  Michael Göldi 

Hy bm

Yes, is it! Do you have a Example for me???

greetz & thx

bm

Re: How can i read the Parameters from a Window in Runtime with CDK

Post by bm » 06 Dec 2002, 13:47

 Posted by:  bm 

Call this Function with the name of the template.

!!CB!! 134
Function: TestCDK
Description:
Returns
Parameters
String: sWindow
Static Variables
Local variables
String: sType
Number: n1
Actions
! We begin at top of Outline
Set n1 = SalOutlineFirstChild( SalOutlineCurrent( ),
alOutlineTop( SalOutlineCurrent( ) ) )
! Get the Item Text
While SalOutlineItemText( SalOutlineCurrent( ), n1, FALSE, sType )
If sType = sWindow
! Go in the form
Set n1 = SalOutlineFirstChild( SalOutlineCurrent( ), n1 )
! Search for 'Window Parameters'
While SalOutlineItemType( SalOutlineCurrent( ), n1 ) != 0x0191
Set n1 = SalOutlineNextLine( SalOutlineCurrent( ), n1 )
! Get the first line after 'Window Paramters'
Set n1 = SalOutlineNextLine( SalOutlineCurrent( ), n1 )
! If Type is 'Form Variables' we didn't have Parameters
If SalOutlineItemType( SalOutlineCurrent( ), n1 ) != 0x0076
While n1
Call SalOutlineItemText( SalOutlineCurrent( ), n1, FALSE, sType )
Select Case SalOutlineItemType( SalOutlineCurrent( ), n1 )
Case 0x0025
Set sType = 'Boolean: '||sType
Break
Case 0x0118
Set sType = 'Class: '||sType
Break
Case 0x003A
Set sType = 'Date/Time: '||sType
Break
Case 0x0067
Set sType = 'File Handle: '||sType
Break
Case 0x009A
Set sType = 'Long String: '||sType
Break
Case 0x00AC
Set sType = 'Number: '||sType
Break
Case 0x00CC
Set sType = 'Sql Handle: '||sType
Break
Case 0x00CE
Set sType = 'String: '||sType
Break
Case 0x00EA
Set sType = 'Window Handle: '||sType
Break
Case 0x00BF
Set sType = 'Receive Boolean: '||sType
Break
Case 0x00C0
Set sType = 'Receive Date/Time: '||sType
Break
Case 0x00C1
Set sType = 'Receive File Handle: '||sType
Break
Case 0x00C2
Set sType = 'Receive Long String: '||sType
Break
Case 0x00C3
Set sType = 'Receive Number: '||sType
Break
Case 0x00C4
Set sType = 'Receive Sql Handle: '||sType
Break
Case 0x00C5
Set sType = 'Receive String: '||sType
Break
Case 0x00C6
Set sType = 'Receive Window Handle: '||sType
Break
Default
Set sType = 'Unknown
|SalNumberToStrX( SalOutlineItemType( SalOutlineCurrent( ), n1 ), 0 )||':
'||sType
Break
Call SalMessageBox( sType, 'Test', MB_Ok )
! Next Line
Set n1 = SalOutlineNextLine( SalOutlineCurrent( ), n1 )
! Go out, if Type is 'Form Variables'
If SalOutlineItemType( SalOutlineCurrent( ), n1 ) = 0x0076
Break
Break
Set n1 = SalOutlineNextLine( SalOutlineCurrent( ), n1 )
If NOT n1
Break
Return FALSE

--

Return to “td.cdk”

Who is online

Users browsing this forum: [Ccbot] and 0 guests