Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Swapping array elements
#1
I'm working on a prog that needs to sort a string, by swapping elements of the string. 
Code: (Select All)
Screen 9
_FullScreen

a$ = "ABCDEFG"
Print Mid$(a$, 3, 1), Mid$(a$, 5, 1)
swap mid$(a$,3,1),mid$(a$,5,1)
?a$
From the description of SWAP in Help, I can do this by naming the elements, but I can't get this to work! In the small sample, the SWAP line is illegal. What am I doing wrong? Obviously, that line was not accepted, as it didn't get capitalized.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
Swapping array elements - by PhilOfPerth - 11-18-2022, 12:06 AM
RE: Swapping array elements - by bplus - 11-18-2022, 12:22 AM
RE: Swapping array elements - by SMcNeill - 11-18-2022, 12:23 AM
RE: Swapping array elements - by bplus - 11-18-2022, 12:27 AM
RE: Swapping array elements - by SMcNeill - 11-18-2022, 12:36 AM
RE: Swapping array elements - by mnrvovrfc - 11-18-2022, 02:49 PM
RE: Swapping array elements - by JRace - 11-18-2022, 04:19 PM
RE: Swapping array elements - by PhilOfPerth - 11-18-2022, 12:46 AM
RE: Swapping array elements - by TerryRitchie - 11-18-2022, 01:09 AM
RE: Swapping array elements - by JRace - 11-18-2022, 01:40 AM
RE: Swapping array elements - by Pete - 11-18-2022, 02:24 AM
RE: Swapping array elements - by SMcNeill - 11-18-2022, 02:41 AM
RE: Swapping array elements - by Pete - 11-18-2022, 02:51 AM
RE: Swapping array elements - by JRace - 11-18-2022, 03:42 AM
RE: Swapping array elements - by Pete - 11-18-2022, 04:15 AM
RE: Swapping array elements - by PhilOfPerth - 11-18-2022, 05:45 AM
RE: Swapping array elements - by Pete - 11-18-2022, 05:57 AM
RE: Swapping array elements - by SMcNeill - 11-18-2022, 12:04 PM
RE: Swapping array elements - by bplus - 11-18-2022, 01:02 PM
RE: Swapping array elements - by mnrvovrfc - 11-18-2022, 02:40 PM
RE: Swapping array elements - by bplus - 11-18-2022, 03:08 PM
RE: Swapping array elements - by bplus - 11-18-2022, 04:21 PM
RE: Swapping array elements - by Pete - 11-18-2022, 06:54 PM
RE: Swapping array elements - by PhilOfPerth - 11-19-2022, 12:12 AM
RE: Swapping array elements - by Pete - 11-19-2022, 12:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  getting the number of dimensions in an array on the fly? madscijr 7 743 09-16-2025, 12:34 AM
Last Post: madscijr
  Testing against multiple elements at a time without select case CMR 4 839 04-17-2025, 02:16 AM
Last Post: CMR
  Endian swapping in QB64pe tantalus 8 1,259 03-22-2025, 05:03 PM
Last Post: Petr
  Quesiton on Dimensioning an Array Dimster 5 1,000 02-06-2024, 01:55 PM
Last Post: Dimster
  ARRAY declaration in GOSUB routines. bartok 19 3,240 02-05-2024, 06:56 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)