Search found 54 matches

by StillLearning
Apr 16, 2023 22:57
Forum: General
Topic: Numeric/String Eval function
Replies: 9
Views: 2202

Re: Numeric/String Eval function

What do you do about overflow and underflow?
by StillLearning
Apr 16, 2023 22:33
Forum: General
Topic: A command line calculator?
Replies: 10
Views: 1939

Re: A command line calculator?

How did you handle number overflow and underflow?
by StillLearning
Oct 12, 2022 18:40
Forum: Beginners
Topic: zstring vs string length
Replies: 6
Views: 1063

Re: zstring vs string length

Thanks everybody . I see the error. Lesson learned.
by StillLearning
Oct 12, 2022 5:29
Forum: Beginners
Topic: zstring vs string length
Replies: 6
Views: 1063

Re: zstring vs string length

I am sorry I did not include some code that was needed. here is the corrected listing: Dim Parts as zstring*40 Dim a as zstring*2 Dim Bins(1 to 3) as string Parts = "" Print "enter staples" do a="" while a="" a=inkey wend print a; Parts = Parts + a loop while ...
by StillLearning
Oct 11, 2022 6:24
Forum: Beginners
Topic: zstring vs string length
Replies: 6
Views: 1063

zstring vs string length

Using this example: Dim Parts as zstring*40 Dim Bins(1 to 3) as string Parts = "staples" Bins(1) = Parts Bins(2) = ""staples" 'Notice the string length for Bins(1) <> Bins(2) 'Now any time Bins() is printed it will always have a additional byte. Is there a easy way to always...
by StillLearning
Oct 03, 2022 15:56
Forum: Beginners
Topic: using allocate/reallocate/deallocate for zstring
Replies: 4
Views: 1109

Re: using allocate/reallocate/deallocate for zstring

Thank you for the information fxm. one question: 1. In my example a save the contents of the zstring to a dynamic string array. I want to use a pointer to access that same array. I saw no examples on how to have a pointer created to access the contents of a dynamic string array. How do I do this? Th...
by StillLearning
Oct 03, 2022 8:50
Forum: Beginners
Topic: using allocate/reallocate/deallocate for zstring
Replies: 4
Views: 1109

using allocate/reallocate/deallocate for zstring

Hello, I have read all of the documentation on using allocate/reallocate/deallocate for zstrings. I created a small test program to test my knowledge. From the results of my test program I saw no benefits in using the allocate/reallocate/deallocate for zstrings. I was under the assumption than if a ...
by StillLearning
Mar 01, 2021 0:11
Forum: Beginners
Topic: byref compiler error
Replies: 2
Views: 525

Re: byref compiler error

Thank you dodicat.
I did not know that was necessary.
by StillLearning
Feb 28, 2021 23:03
Forum: Beginners
Topic: byref compiler error
Replies: 2
Views: 525

byref compiler error

I have created a small code example of a error I keep on getting when attempting to use byref to return 2 different parameters. Here is the code: declare sub ValidateLeadingSign(_ Digit as string,_ PlusExists as byte,_ MinusExists as byte) declare sub GetOperand() Dim shared TxtLine as ZString*513 '...
by StillLearning
Feb 23, 2021 3:30
Forum: Beginners
Topic: How to modularize code
Replies: 16
Views: 1988

How to modularize code

To anybody who can point me to a tutorial on how to create multiple files (modules) that you link together and become a freebasic program. I have separate subs and functions and global variables with global structures working as 1 BIG file but would link to know what to do to have them as separate m...
by StillLearning
Jan 26, 2021 3:40
Forum: Beginners
Topic: strings using []
Replies: 9
Views: 1487

Re: strings using []

Thank you MrSwiss and fxm. That information helped a lot. I think I might have found a bug unless I need to do some more reading about zstrings. Dim UpperLabel as zstring*247 dim Text as zstring*1 Dim Index as uByte Dim AscChar as uByte dim Label as string Dim Text1 as string input "enter lower...
by StillLearning
Jan 24, 2021 23:11
Forum: Beginners
Topic: strings using []
Replies: 9
Views: 1487

Re: strings using []

Thank you fxm.

Did not realize that string indexes started at 0 instead of 1.
Is there a document that covers using [] for strings?
I did not see one.
by StillLearning
Jan 24, 2021 22:28
Forum: Beginners
Topic: strings using []
Replies: 9
Views: 1487

strings using []

Does freebasic support this type of code: Dim shared UpperLabel as zstring*247 Dim STRChar as zstring*1 Dim Index as ubyte Dim KeyString as string do Input "my key word = ";STRChar UpperLabel[Index] = STRChar[1] print "UpperLabel ";UpperLabel print "UpperLabel length = "...
by StillLearning
Dec 10, 2020 3:21
Forum: Beginners
Topic: How to use a pointer for a ulong number
Replies: 13
Views: 2548

Re: How to use a pointer for a ulong number

Here is the code I ended up using. It allows a Ulong value that is converted to a string by size in bytes. That means a number that is &h12345678 can be truncated to 2 or 1 byte by the size specified. I needed this for to make a string that is based on a register size or a ptr size of a memory a...
by StillLearning
Dec 10, 2020 1:59
Forum: Beginners
Topic: Misunderstanding of using VAR?
Replies: 6
Views: 1535

Re: Misunderstanding of using VAR?

Thanks everybody for the explanation. Too bad this doesn't work in freebasic.
It would have been an easy way to dynamically type variables.