Author Topic: STRINGS FEATURE  (Read 3687 times)

0 Members and 1 Guest are viewing this topic.

Offline mrwrite

  • Newbie
  • Posts: 4
  • i still have Win2000 on one of my computers.
    • View Profile
STRINGS FEATURE
« on: January 16, 2021, 10:12:09 pm »
I just downloaded QB64 recently and discovered an added plus.  QB64 has super strings!
The old QBASIC was limited to 32,767 characters in a string. It rrequired a DIM statement for large strings and sometimes a SET statement. (I remember using the SET statement but don't recall how.)

Just did a few tests and made a string over 80,000 characters. That is twice as big as I need.

I have an idea for a program to make a word puzzle. I have the words, working on the definitions, and I did something like this before. (In the previous century.)
Made with recycled electrons.

FellippeHeitor

  • Guest
Re: STRINGS FEATURE
« Reply #1 on: January 16, 2021, 10:13:21 pm »
Welcome aboard, mrwrite! Glad you're having a good time 😉

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: STRINGS FEATURE
« Reply #2 on: January 16, 2021, 10:39:11 pm »
Did some tests

DIM a AS STRING * 2147483647
PRINT LEN(a)

gives an "OUT OF MEMORY " on my comp, it might work on yours

but
DIM a AS STRING * 2147483648

won't compile
so  2147483647   (2^31 -1) is the largest QB64 string?

FellippeHeitor

  • Guest
Re: STRINGS FEATURE
« Reply #3 on: January 16, 2021, 10:43:02 pm »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: STRINGS FEATURE
« Reply #4 on: January 17, 2021, 09:07:00 am »
:D "Previous century." Good luck on your word puzzle program... as long as it uses SCREEN 0. If not burn in...

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline mrwrite

  • Newbie
  • Posts: 4
  • i still have Win2000 on one of my computers.
    • View Profile
Re: STRINGS FEATURE
« Reply #5 on: January 25, 2021, 11:11:02 pm »
:as long as it uses SCREEN 0. If not burn in...

Typically, my programs run for DAYS or even weeks. I am hoping QB64 will be faster. So, I usually leave the screen off and turn it on to check it about three times a day. Thank you for the reminder.
Made with recycled electrons.

Offline mrwrite

  • Newbie
  • Posts: 4
  • i still have Win2000 on one of my computers.
    • View Profile
Re: STRINGS FEATURE
« Reply #6 on: January 25, 2021, 11:15:45 pm »
https://www.qb64.org/wiki/Variable_Types

Max size:  2,147,483,647

Useful to know! Far ABOVE my plans.
 (No point in trying to reach the moon building a sand castle.)
Made with recycled electrons.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: STRINGS FEATURE
« Reply #7 on: January 25, 2021, 11:18:53 pm »
Typically, my programs run for DAYS or even weeks. I am hoping QB64 will be faster. So, I usually leave the screen off and turn it on to check it about three times a day. Thank you for the reminder.

LOL I haven't thought about screen "burn in" since the old days before the new type screens. @mrwrite  I bet you've been around for awhile!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: STRINGS FEATURE
« Reply #8 on: January 26, 2021, 11:42:09 am »
Yeah, the good old days of screen burn. I thought I had that solved, but it turned out putting sun screen on the monitor just caused screen burn plus blurring.

There's always a solution. Preferably one with Vodka in it.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline mrwrite

  • Newbie
  • Posts: 4
  • i still have Win2000 on one of my computers.
    • View Profile
Re: STRINGS FEATURE
« Reply #9 on: January 27, 2021, 10:13:01 pm »
I first used QBASIC about 1992.  QBASIC destroyed my favorite puzzle. I would present a list of  13 nine-digit numbers and ask which one is the prime. (Numbers were sequential from 99,999,999 to 100,000,011.) I gave the hint that 100,000,003 is NOT a prime. (Not that it matters, it is evenly divisible by 643.)

With the old BASIC you needed double precision to do numbers above 6 digits. Few could remember how to do that. With QBASIC, the problem could be solved using long integers (%).

My Atari BASIC had 8 digit accuracy and would also produce an accurate 10-digit result.

The point of the exercise was just to show how lazy programmers are. By using logic, you can eliminate all but two number. ((10^8)+1) and ((10^8)+7). With all others eliminated by lower primes, all anyone needs to do is divide the last two numbers by the next two primes (13 and 17) to learn which ONE is the prime. This could have been done by the calculator in MS-DOS. NOT by the fancy expensive calculator they had hanging on their belt. They nearly all had 8 digits.

So many, wouldn't even try to write the program. We were all that lazy. Most just say they couldn't do it.

I always had respect for QBASIC. I liked the built-in ASCII chart and the math line. (Both retained by QB64 --Thank you.)

I remember reading that Microsoft released GW-BASIC under the MIT license in 2020. I am in no hurry to find it.
Made with recycled electrons.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: STRINGS FEATURE
« Reply #10 on: January 27, 2021, 10:49:45 pm »
I'll see your Atari BASIC (I had one of those) and lower you a TI44A.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/