home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / Get Values.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  1.1 KB  |  35 lines

  1. 'output from file
  2. open "i", 1, "steve.txt"            'open needed file
  3. do while eof(1) = 0                'do till file empty
  4. input #1, a$                    'get a line
  5.  
  6. long=LEN(a$)                    'get line length    
  7. b$ = ","                    'comma to search for
  8. comma =     INSTR(a$, b$)            'place of comma
  9. t=1                        'start of line
  10. c$=MID$(a$, t, comma-1)                'get needed stuff
  11. d$=MID$(a$, comma+1, long)            'get rest of line
  12.  
  13. long=LEN(d$)                    'length of rest of line
  14. comma =     INSTR(d$, b$)            'next comma
  15. e$=MID$(d$, t, comma-1)                'next needed stuff
  16. f$=MID$(d$, comma+1, long)            'rest of line    
  17.  
  18. long=LEN(f$)                    'length of whats left
  19. comma =     INSTR(f$, b$)            'last comma place
  20. g$=MID$(f$, t, comma-1)                'next to last stuff
  21. h$=MID$(f$, comma+1, long)            'get last stuff
  22.  
  23. z1=VAL(e$)                    'make string a number    
  24. z2=VAL(g$)                    'make string a number    
  25. z3=VAL(h$)                    'make string a number    
  26. print c$                    'output string with pause
  27. anykey
  28. print z1                    'output number with pause
  29. anykey
  30. print z2                    'output number with pause
  31. anykey
  32. print z3                    'output number with pause
  33. anykey
  34. loop                        'do again till end of file
  35.