program INPCSV,1.0(100) ! INPUT CSV implemented as an SBX !-------------------------------------------------------------------------- !EDIT HISTORY ! 29-Dec-09 Created !-------------------------------------------------------------------------- !NOTES ! xcall INPCSV,CH,A1$,A2${,A3$,A4$,....,A99$} !-------------------------------------------------------------------------- ++pragma SBX ++include ashinc:xcall.bsi define MAX_FIELDS = 99 map1 a$(MAX_FIELDS),s,0 ! array of dynamic vars map1 channel,f map1 i,f xgetargs channel ! only one input param ! note: it is not normally necessary to pre-init vars in an SBX, but in ! the case of dynamic vars, it might be a good idea (since dynamic vars ! have different persistence characteristics) for i = 1 to MAX_FIELDS a$(i) = "" next i ! handle up to 99 fields (unused ones will be left blank) input csv #channel, & a$(1),a$(2),a$(3),a$(4),a$(5),a$(6),a$(7),a$(8),a$(9),a$(10), & a$(11),a$(12),a$(13),a$(14),a$(15),a$(16),a$(17),a$(18),a$(19),a$(20), & a$(21),a$(22),a$(23),a$(24),a$(25),a$(26),a$(27),a$(28),a$(29),a$(30), & a$(31),a$(32),a$(33),a$(34),a$(35),a$(36),a$(37),a$(38),a$(39),a$(40), & a$(41),a$(42),a$(43),a$(44),a$(45),a$(46),a$(47),a$(48),a$(49),a$(50), & a$(51),a$(52),a$(53),a$(54),a$(55),a$(56),a$(57),a$(58),a$(59),a$(60), & a$(61),a$(62),a$(63),a$(64),a$(65),a$(66),a$(67),a$(68),a$(69),a$(70), & a$(71),a$(72),a$(73),a$(74),a$(75),a$(76),a$(77),a$(78),a$(79),a$(80), & a$(81),a$(82),a$(83),a$(84),a$(85),a$(86),a$(87),a$(88),a$(89),a$(90), & a$(91),a$(92),a$(93),a$(94),a$(95),a$(96),a$(97),a$(98),a$(99) ! return just those that were passed to us for i = 2 to XCBCNT xputarg i,a$(i-1) next i end