| | 5 | == Constructor == |
| | 6 | |
| | 7 | {{{ |
| | 8 | CTktFlds(void); |
| | 9 | }}} |
| | 10 | |
| | 11 | ==== Parameters ==== |
| | 12 | |
| | 13 | Constructor does not accept any parameters |
| | 14 | |
| | 15 | ==== Examples ==== |
| | 16 | |
| | 17 | {{{ |
| | 18 | CTktFlds flds; |
| | 19 | }}} |
| | 20 | |
| | 21 | This contructs the object. |
| | 22 | |
| | 23 | == Member Functions == |
| | 24 | |
| | 25 | === Clear === |
| | 26 | Clears all references or a specified item. |
| | 27 | |
| | 28 | {{{ |
| | 29 | void Clear(void); |
| | 30 | |
| | 31 | void Clear(int nFld); |
| | 32 | }}} |
| | 33 | |
| | 34 | ==== Parameters ==== |
| | 35 | |
| | 36 | * nFld - Ticket item to clear |
| | 37 | Version with no parameters clears all fields |
| | 38 | |
| | 39 | ==== Return Value ==== |
| | 40 | |
| | 41 | Function does not return a result. |
| | 42 | |
| | 43 | ==== Remarks ==== |
| | 44 | |
| | 45 | ==== Examples ==== |
| | 46 | |
| | 47 | {{{ |
| | 48 | CTktFlds flds; |
| | 49 | flds.Set(TKT_FLD_TIME, strTime); |
| | 50 | flds.Set(TKT_FLD_GROSS, strGross); |
| | 51 | PrintTkt(TKT_STD, flds); |
| | 52 | |
| | 53 | // Clear the entire flds object to start over |
| | 54 | flds.Clear(); |
| | 55 | flds.Set(TKT_FLD_TIME, strTime); |
| | 56 | flds.Set(TKT_FLD_NET, strNet); |
| | 57 | PrintTkt(TKT_ALT, flds); |
| | 58 | }}} |
| | 59 | |
| | 60 | {{{ |
| | 61 | CTktFlds flds; |
| | 62 | flds.Set(TKT_FLD_TIME, strTime); |
| | 63 | flds.Set(TKT_FLD_GROSS, strGross); |
| | 64 | PrintTkt(TKT_STD, flds); |
| | 65 | |
| | 66 | // Clear the gross weight reference so it will not print on the alternate ticket, time will still print |
| | 67 | flds.Clear(TKT_FLD_GROSS); |
| | 68 | flds.Set(TKT_FLD_NET, strNet); |
| | 69 | PrintTkt(TKT_ALT, flds); |
| | 70 | }}} |
| | 71 | |
| | 72 | === Set === |
| | 73 | Sets a reference |
| | 74 | {{{ |
| | 75 | void Set(int nFld, string& str); |
| | 76 | void Set(int nFld, char* psz); |
| | 77 | void Set(int nFld, const char* psz); |
| | 78 | }}} |
| | 79 | |
| | 80 | ==== Parameters ==== |
| | 81 | |
| | 82 | * nFld - Field to set |
| | 83 | * str - String variable |
| | 84 | * psz - pointer to character array |
| | 85 | |
| | 86 | ==== Retrun Value ==== |
| | 87 | |
| | 88 | Function does not return any result. |
| | 89 | |
| | 90 | ==== Remarks ==== |
| | 91 | |
| | 92 | |
| | 93 | ==== Example ==== |
| | 94 | |
| | 95 | {{{ |
| | 96 | string strTime = GetTimeStr(1); // Include seconds |
| | 97 | string strGross = FormatGrossWt(1); |
| | 98 | |
| | 99 | CTktFlds flds; |
| | 100 | flds.Set(TKT_FLD_TIME, strTime); |
| | 101 | flds.Set(TKT_FLD_GROSS, strGross); |
| | 102 | PrintTkt(TKT_STD, flds); |
| | 103 | }}} |
| | 104 | |