Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indicator type #199

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions samples/data-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Data Types for XMLSERVICE and PHP Toolkit #

This reference, written by Tony Cairns while at IBM, used to be housed at `http://www.youngiprofessionals.com/wiki/index.php/XMLService/DataTypes`, but that site is no longer available, so we have made it available here.
This reference, written by Tony Cairns while at IBM, used to be housed at `http://www.youngiprofessionals.com/wiki/index.php/XMLService/DataTypes`, but that site is no longer available, so we have made it available here, and added to it.

## Data Type Equivalents for C / RPG / XMLSERVICE XML / SQL ##

Expand Down Expand Up @@ -28,34 +28,36 @@ uint8/ubyte D myuint8 3u 0 <data type='3u0'/>
uint16/ushort D myuint16 5u 0 <data type='5u0'/>
uint32/uint D myuint32 10u 0 <data type='10u0'/>
uint64/ulonglong D myuint64 20u 0 <data type='20u0'/>
[indicator] D myind 1a <data type='1a'/>

```

## PHP Toolkit Functions That Implement the XMLSERVICE Data Types Shown Above ###

```
toolkit method/class type i/o comment varName value
======================= ===== ====== ======= ======== =====
$tk->AddParameterChar ( "both",32, "char", "mychar", "");
$tk->AddParameterChar ( "both",32, "varchar2", "myvchar2", "", "on");
$tk->AddParameterChar ( "both",32, "varchar4", "myvchar4", "", 4);
$tk->AddParameterZoned ( "both",12,2,"packed", "mydec", 0.0);
$tk->AddParameterPackDec( "both",12,2,"zoned", "myzone", 0.0);
$tk->AddParameterFloat ( "both", "float", "myfloat", 0.0);
$tk->AddParameterReal ( "both", "real", "myreal", 0.0);
$tk->AddParameterBin ( "both", 9, "binary", "mybin", bin2hex(0xF1F2F3)); // to binary pack("H*", $hex)
$tk->AddParameterHole ( 40, "hole" ); // no output (zero input)
$tk->AddParameterChar ( "both", 4, "boolean", "mybool", "1");
$tk->AddParameterChar ( "both", 8, "time", "mytime", "09.45.29");
$tk->AddParameterChar ( "both", 26, "timestamp", "mystamp", "2011-12-29-12.45.29.000000");
$tk->AddParameterChar ( "both", 10, "date", "mydate", "2009-05-11");
new ProgramParameter ("3i0","both", "byte", "myint8", 0); // work around missing $tk->AddParameterInt8
new ProgramParameter ("5i0","both", "short", "myint16", 0); // work around missing $tk->AddParameterInt16
$tk->AddParameterInt32 ( "both", "int", "myint32", 0);
$tk->AddParameterInt64 ( "both", "longlong", "myint64", 0);
new ProgramParameter ("3u0","both", "ubyte", "myuint8", 0); // work around missing $tk->AddParameterUInt8
new ProgramParameter ("5u0","both", "ushort", "myuint16", 0); // work around missing $tk->AddParameterUInt16
$tk->AddParameterUInt32 ( "both", "uint", "myuint32", 0);
$tk->AddParameterUInt64 ( "both", "ulonglong", "myuint64", 0);
toolkit method/class type i/o comment varName value
======================= ===== ====== ======= ======== =====
$tk->AddParameterChar ( "both",32, "char", "mychar", "");
$tk->AddParameterChar ( "both",32, "varchar2", "myvchar2", "", "on");
$tk->AddParameterChar ( "both",32, "varchar4", "myvchar4", "", 4);
$tk->AddParameterZoned ( "both",12,2,"packed", "mydec", 0.0);
$tk->AddParameterPackDec( "both",12,2,"zoned", "myzone", 0.0);
$tk->AddParameterFloat ( "both", "float", "myfloat", 0.0);
$tk->AddParameterReal ( "both", "real", "myreal", 0.0);
$tk->AddParameterBin ( "both", 9, "binary", "mybin", bin2hex(0xF1F2F3)); // to binary pack("H*", $hex)
$tk->AddParameterHole ( 40, "hole" ); // no output (zero input)
$tk->AddParameterChar ( "both", 4, "boolean", "mybool", "1");
$tk->AddParameterChar ( "both", 8, "time", "mytime", "09.45.29");
$tk->AddParameterChar ( "both", 26, "timestamp", "mystamp", "2011-12-29-12.45.29.000000");
$tk->AddParameterChar ( "both", 10, "date", "mydate", "2009-05-11");
new ProgramParameter ("3i0","both", "byte", "myint8", 0); // work around missing $tk->AddParameterInt8
new ProgramParameter ("5i0","both", "short", "myint16", 0); // work around missing $tk->AddParameterInt16
$tk->AddParameterInt32 ( "both", "int", "myint32", 0);
$tk->AddParameterInt64 ( "both", "longlong", "myint64", 0);
new ProgramParameter ("3u0","both", "ubyte", "myuint8", 0); // work around missing $tk->AddParameterUInt8
new ProgramParameter ("5u0","both", "ushort", "myuint16", 0); // work around missing $tk->AddParameterUInt16
$tk->AddParameterUInt32 ( "both", "uint", "myuint32", 0);
$tk->AddParameterUInt64 ( "both", "ulonglong", "myuint64", 0);
$tk->AddParameterChar ( "out", 1, "ind '0'/'1'" "myind", ""); // indicator type is boolean 1-byte character

```