Search found 351 matches

by Cherry
Sep 18, 2014 11:35
Forum: Tips and Tricks
Topic: [Win32] Exception handling using Try/Catch/Finally
Replies: 17
Views: 7045

Re: [Win32] Exception handling using Try/Catch/Finally

You are welcome, however I just realized that there is obviously some kind of bug in the new [ code ] feature in the forums - at the end of my code I found this: {__params__} this should be {__params__} and I definitely didn't put the HTML entities there... EDIT: Wow, clicking &quo...
by Cherry
Sep 06, 2014 6:37
Forum: General
Topic: How can I detect an empty array?
Replies: 14
Views: 1330

Re: How can I detect an empty array?

Right, this would make even more sense, because you can calculate the size using ubound-lbound+1, which would then (and only then) be zero.
by Cherry
Sep 06, 2014 5:38
Forum: General
Topic: How can I detect an empty array?
Replies: 14
Views: 1330

Re: How can I detect an empty array?

Yes, that would be great. Of course, Erase can additionally be used, and it's more understandable (for humans), but I think using a ubound<lbound is an elegant solution to prevent the need for additional conditions in the code, because for loops, this trick works already.
by Cherry
Sep 06, 2014 5:18
Forum: General
Topic: How can I detect an empty array?
Replies: 14
Views: 1330

Re: How can I detect an empty array?

@working in 0.91: Oh, cool, where do I get a Windows build of 0.91? The last official build is 0.90.1 (which I have), right? @Allowing -1: That was exactly my point: Whether "Erase" can be used or not doesn't make a difference in that it's not making sense to have two different syntaxes fo...
by Cherry
Sep 05, 2014 18:52
Forum: General
Topic: How can I detect an empty array?
Replies: 14
Views: 1330

Re: How can I detect an empty array?

Hm, my compiler version is "Version 0.90.1 (07-17-2013) for win32". OK, I have to revise my initial statement: Dim x() As Integer Print LBound(x), UBound(x) Sleep This program indeed prints 0, -1 But: Dim y As Integer = -1 Dim x(y) As Integer Print LBound(x), UBound(x) Sleep This program p...
by Cherry
Sep 04, 2014 21:04
Forum: General
Topic: How can I detect an empty array?
Replies: 14
Views: 1330

How can I detect an empty array?

Hello, I noticed that an empty array (declared as "Dim array() As Integer" or "Dim array(size - 1) As Integer" with size being 0) incorrectly gets LBound and UBound reported as 0. Therefore, For i As Integer = LBound(array) To UBound(array) will iterate over the non-exist...
by Cherry
Sep 04, 2014 20:53
Forum: General
Topic: OverLoad: Duplicated Definition?
Replies: 1
Views: 267

OverLoad: Duplicated Definition?

Hello! OverLoad is supposed to allow subs/functions with the same name, but different signatures, right? OK, then, why am I getting a duplicated definition error here? Declare Sub RunEventCommand OverLoad (cmd As Integer, text As String = "", params() As Integer) Declare Sub RunEventComman...
by Cherry
Jun 05, 2013 16:48
Forum: Windows
Topic: Possible GetMouse BUG when called in a subroutine
Replies: 6
Views: 938

Re: Possible GetMouse BUG when called in a subroutine

By the way, GetMouse(x,y,buttons) is wrong, you need GetMouse(x,y,,buttons) because between y and buttons there is a mousewheel parameter.
by Cherry
Apr 12, 2013 15:22
Forum: General
Topic: Trying to make maro for INCR and DECR
Replies: 16
Views: 1209

Re: Trying to make maro for INCR and DECR

You could use Notepad++ and a simple regular expression to replace all INCR/DECR calls with the correct FB syntax. Open your file in Notepad++, press Ctrl+R and configure it like this: http://share.cherrytree.at/showfile-9588/regex.png The left configuration will replace INCR (press Find and then Re...
by Cherry
Mar 31, 2013 16:31
Forum: General
Topic: this refuses to compile.
Replies: 10
Views: 849

Re: this refuses to compile.

No, you probably only need to define the type once. And if you want to move the sub outside the type, no problem, it was just a suggestion.

By the way, the last message was adressed to Merick, I wrote "Akuma" only by mistake.
by Cherry
Mar 31, 2013 12:37
Forum: General
Topic: this refuses to compile.
Replies: 10
Views: 849

Re: this refuses to compile.

Merick, what's the difference now? I don't see your point, your code is effectively doing the same as mine, just in a more verbose way.
by Cherry
Mar 30, 2013 22:42
Forum: General
Topic: this refuses to compile.
Replies: 10
Views: 849

Re: this refuses to compile.

Well, even though it compiles, it's still wrong. 1) You load data from an array into variables (x1, y1, x2, y2) and afterwards, you use those variables as index for the array, so you are effectively accessing InLiner.AVL(300), etc., which is far beyond the array bounds (0 to 4)! This will result in ...
by Cherry
Mar 28, 2013 0:57
Forum: Windows
Topic: How do I find the file permissions (rwx--x-wx) on FTP
Replies: 2
Views: 579

Re: How do I find the file permissions (rwx--x-wx) on FTP

I think you need to send STAT to the server with the directory as parameter (e.g. STAT /var/www/html) and you will get a list of all files back, including their permissions, like this: drwxr-xr-x 4 505 507 4096 Jan 09 19:09 . drwxr-xr-x 4 505 507 4096 Jan 09 19:09 .. drwxr-xr-x 6 505 507 4096 Dec 04...
by Cherry
Mar 25, 2013 14:34
Forum: General
Topic: Larger font in larger output console window
Replies: 9
Views: 1308

Re: Larger font in larger output console window

I do not understand the code posted by I3I2UI/I0 but I tried it and when I execute the compiled code, Windows immediately says it encountered a problem and closes the window. It only works with Windows Vista and above. In general, you might really consider using a graphics window using ScreenRes an...
by Cherry
Mar 12, 2013 11:49
Forum: General
Topic: Duplicated definition in operator =
Replies: 15
Views: 1247

Re: Duplicated definition in operator =

I think it shouldn't be the same, because String<>String compares contents while ZString Ptr<>ZString Ptr compares pointers.

Go to advanced search