home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / xw2.000 / xw2 / xw / samples / string-handling / addstrings
Encoding:
Text File  |  1994-12-05  |  1.0 KB  |  30 lines

  1. %  This sample shows how to
  2. %  - create two String-Objects
  3. %  - concatenate their values into a third object
  4. %  - show the result of the addition "on the fly"
  5.  
  6. % Remark: first have a look at ../arithmetic/calculate.xwx !
  7.  
  8. Malloc(90);                              %Get memory
  9. @xbwstart(("simple-project") ("bw"));    %Setup xbw system in "bw"/"color"
  10. wdw(TEST 3 4 20 11 StandardWDW);
  11.  
  12. o(TEST1 S S 2 3 15 1 Standard);  bg(TEST1 . ("StringA") ); eg();
  13. o(TEST2 S S 2 4 15 1 Standard);  bg(TEST2 . ("StringB") ); eg();
  14. o(TEST3 S S 2 7 15 1 Standard);
  15.   bg(TEST3 .   ("                                    ") ); eg();
  16.  
  17. ?("First VAR-PARAMETER: ");                   ?(str)OBJ:TEST1.V;
  18. ?("Second VAR-PARAMETER:");                   ?(str)OBJ:TEST2.V;
  19. ?("Concatenate Result:");
  20.   $a:=(str)OBJ:TEST1.V,(str)OBJ:TEST2.V;      ?($a); % creating a temp.variable
  21. ?("Now putting the result in object TEST3");  (str)OBJ:TEST3.V := ($a);
  22.  
  23. o(TEST4 S . 2 9 15 1 Secure);
  24. bg(TEST4 . (" Exit"));
  25.   cn(raK("@xbwstop();"));
  26.   eg();
  27. Message(("Project Complete."));     %That's it!
  28. End();
  29.  
  30.