Search found 541 matches

by sancho2
Sep 22, 2017 3:37
Forum: Beginners
Topic: Using string function [SOLVED]
Replies: 36
Views: 6200

Re: Using string function

because I am used to that what is described as the correct syntax for using something *is* the correct syntax for using something - if you know what I mean..... Besides the Usage section which is immediately below the syntax section, there is also the example code which shows how to use the functio...
by sancho2
Sep 17, 2017 6:24
Forum: General
Topic: Bug or not? Boolean warning. Can you help me make sure it is? [SOLVED]
Replies: 6
Views: 1946

Re: Bug or not? Boolean warning. Can you help me make sure it is?

1.06 is not yet released though. Is that right?
by sancho2
Sep 17, 2017 1:36
Forum: General
Topic: Bug or not? Boolean warning. Can you help me make sure it is? [SOLVED]
Replies: 6
Views: 1946

Re: Bug or not? Boolean warning. Can you help me make sure it is?

Try: If b = True And cbool(n = 5) Then This is known and it is talked about in this forum. I will see if I can find the thread and report back. Found it FXM says: Most of time, the operator "=" (Equal) returns an Integer presently. (exception: a boolean is returned only if the compared exp...
by sancho2
Sep 04, 2017 1:22
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V3.1.0 June 4, 2023)
Replies: 979
Views: 343965

Re: WinFBE FreeBASIC Editor for Windows (Updated September 3, 2017)

How about user-submitted themes?
Are you saving themes in a separate file or is it all in one config?
If it is a separate file then a person could share their theme with others.
by sancho2
Sep 03, 2017 2:59
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 415
Views: 45962

Re: FreeBASIC syntax challenge games

Ok 2 days fighting with this one. I think I have the solution, but I don't fully understand what is happening.

Code: Select all

IIf(Cast(object, (expression)) Is typename, Cast(String, typename), Cast(String, *Cast(typename Ptr, 0)))
by sancho2
Aug 26, 2017 23:47
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

The following code is a revamped version. It eliminates the initialization checks and treats the first assignment to the variable as is_changed = true. (The cls and error messages are just for me because I use FBEdit and it won't show me error 10) Type StateVar Private: Enum _type _none _int _string...
by sancho2
Aug 26, 2017 21:42
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

Of course. This is the very issue that started this thread. Now I am looking at cast() as string. It should also return byref for the same reason. The problem is that it also returns str(_int_value) if the object is an integer. I can't just use a procedure level variable to hold the string value bec...
by sancho2
Aug 26, 2017 19:34
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

Can you give me an example of what writing to _int_value would look like in code?
by sancho2
Aug 26, 2017 18:05
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

It seems the GetMouse is overloaded and doesn't like my statevar. It returns an ambiguous call error. Its easy to resolve by using Getmouse(cint(mystatevarX), mystatevarY). '----------------------------------------------------------------------------------------- ' 08-22-2017 - 18:18:40 (mm/dd/yyyy)...
by sancho2
Aug 26, 2017 15:22
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

Well I didn't see that one either. But what I meant was it shouldn't reach it based on no logic errors. Its exactly as you stated, only safe for simple data types. How about this instead: operator StateVar.Cast() As String ' If this.init_flag = _string Then Return This._string_value ElseIf this.init...
by sancho2
Aug 26, 2017 8:41
Forum: Documentation
Topic: exit sub ,exit function
Replies: 9
Views: 4054

Re: exit sub ,exit function

The complier gives out a warning for "Function not explicitly set" when there is no return in it. Shouldn't the compiler warn me if all the paths to the return are hidden behind if statements? Or maybe a better way to phrase is to say that there should be a warning if there is a possible p...
by sancho2
Aug 26, 2017 8:26
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

I fixed the sub. In theory the code should never reach the end of the cast without hitting one of the returns. The only reason I had the elseif was in case I added another data type (maybe double) down the road. But safer is better so I added the fix. I tried out the code you linked and yes that is ...
by sancho2
Aug 26, 2017 1:12
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

Your code is essentially the same as mine. The differences I can find: Your class behaves as though it were a container for two variables, a string and an integer. When my object is assigned a string and then an integer, it forgets it was a string and considers itself re-initialized. If it changes t...
by sancho2
Aug 25, 2017 4:28
Forum: General
Topic: Program Timing
Replies: 2
Views: 1181

Re: Program Timing

You can put code tags around your code and it will look like this:

Code: Select all

print "use code tags, thanks"
sleep
by sancho2
Aug 25, 2017 3:18
Forum: General
Topic: Property returns incorrect object
Replies: 24
Views: 5154

Re: Property returns incorrect object

I didn't see that fxm, but yes you are right. I had already changed it to a member variable and not a boolean. This was to accomodate integers as well as strings. Here is the code, still not complete and not fully tested: Type StateBase Public: Enum _type _none _int _string End Enum As _type init_fl...