|
| 1 | +// Data structure is easy to add. It's just another parameter. |
| 2 | + |
| 3 | +$param = []; // initialize parameter array |
| 4 | + |
| 5 | +// add parameters as desired |
| 6 | +$param[] = $tk->AddParameterChar('in', 10,'Name', 'PTNAME', 'Fred'); |
| 7 | +$param[] = $tk->AddParameterChar('in', 25,'Address', 'PTADDR', '123 Toolkit Drive'); |
| 8 | + |
| 9 | +// DATA STRUCTURE |
| 10 | +// Define the data structure as an array of basic parameter types or other data structures |
| 11 | +$ds = []; |
| 12 | +$ds[] = $tk->AddParameterChar('in', 21,'Part', 'PTPRT', 'A123'); |
| 13 | +$ds[] = $tk->AddParameterChar('in', 3,'Vendor', 'PTVEN', '825'); |
| 14 | +$ds[] = $tk->AddParameterChar('out', 20,'Description', 'PTDES', $out); |
| 15 | +$ds[] = $tk->AddParameterZoned('out', 9, 2, 'Price', 'PTPRC', $out); |
| 16 | + |
| 17 | +// Add the data structure as just another element in your main parameter array. |
| 18 | +$param[] = $tk->AddDataStruct($ds, 'myds'); |
| 19 | + |
| 20 | +// Add additional regular parameters as needed |
| 21 | +$param[] = $tk->AddParameterZoned('in', 5, 2, 'Discount', 'PTDISC', '0.24'); |
0 commit comments