Re: A file

 BBS: Inland Empire Archive
Date: 02-13-93 (08:17)             Number: 304
From: BOB PERKINS                  Refer#: NONE
  To: JEFFERY FOY                   Recvd: NO  
Subj: Re: A file                     Conf: (2) Quik_Bas
 JF> Btw, to keep on topic... Here's a challenge... Without using MID$,
 JF> LEFT$, RIGHT$, or INSTR, reverse the characters in a 10-byte string such
 JF> that:  "0123456789" becomes "9876543210".  I thought it'd be easy but
 JF> find that it isn't... :)

  Here's a quick workup that seems to do the job:

  test$ = "0123456789"
  temp$ = SPACE$(10)

  source% = SADD(test$)
  work% = SADD(temp$)
  PRINT "Original  : "; test$
  r% = 9
  FOR x% = 0 TO 9
    t% = PEEK(source% + x%)
    POKE work% + r%, t%
    r% = r% - 1
  NEXT x%
  test$ = temp$
  PRINT "Changed to: "; test$



--- Msg V4.5
 * Origin: Reciprocity Failure  (1:124/4115.236)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET