Search found 3288 matches

by MrSwiss
Jan 19, 2020 20:17
Forum: Hardware Interfaces / Communication
Topic: FreeBasic communication with Arduino logic error?
Replies: 57
Views: 18300

Re: FreeBasic communication with Arduino logic error?

Nothing wrong with the concept, however, the code is "disinformation".

Reason: no Arduino can deal with Double (data-type) since, Single is
the only supported floating point type (aka: float, in AVR-C).
by MrSwiss
Jan 19, 2020 16:07
Forum: Hardware Interfaces / Communication
Topic: FreeBasic communication with Arduino logic error?
Replies: 57
Views: 18300

Re: FreeBasic communication with Arduino logic error?

Do I simply format the content of the variables as a string of text, serial print them, and then de-format them into variables again on reception? Yes, this should do. Or is there a better or less cumbersome way to do it? If cumbersome is meant to refer to string-splitting, there are some solutions...
by MrSwiss
Jan 17, 2020 21:35
Forum: Beginners
Topic: text viewport
Replies: 2
Views: 104

Re: text viewport

For diferent window coordinates (grapics mode) you'll want to look at: Window command.

The code you've posted uses WIN-API, which means: it's no longer OS independent.
(FB only code is OS independent, for all by FB supported platforms.)
by MrSwiss
Jan 17, 2020 15:25
Forum: Beginners
Topic: Key inkey getkey
Replies: 21
Views: 412

Re: Key inkey getkey

Why using old code, that has not been updated for ages? Use example code from current FB-Manual (*.chm), instead: 'Example 2: type-union-type structure Type mouse As Integer res As Integer x, y, wheel, clip Union buttons As Integer Type Left:1 As Integer Right:1 As Integer middle:1 As Integer End Ty...
by MrSwiss
Jan 16, 2020 12:49
Forum: Community Discussion
Topic: Unable to access fb.net forums
Replies: 86
Views: 3176

Re: Unable to access fb.net forums

Suggestion:
replacing the Q&A with one or more CAPTCHA's may be more effective?
(easier on users while being harder for machines)
by MrSwiss
Jan 16, 2020 1:20
Forum: Community Discussion
Topic: Unable to access fb.net forums
Replies: 86
Views: 3176

Re: Unable to access fb.net forums

coderJeff wrote:"period" is a literal. Too hard?

Yes, I guess it is, because everybody is likely to assume "." (if literal isn't stated somewhere).
by MrSwiss
Jan 15, 2020 0:31
Forum: Hardware Interfaces / Communication
Topic: Serial Read Write From PC USB to HP 34401A meter DB-9[Solved]
Replies: 17
Views: 406

Re: Serial Read Write From DB-9 Device Connector to PC USB

Try to increase the sleep value (in the loop, between send & receive), step by step ...
by MrSwiss
Jan 15, 2020 0:05
Forum: Hardware Interfaces / Communication
Topic: Serial Read Write From PC USB to HP 34401A meter DB-9[Solved]
Replies: 17
Views: 406

Re: Serial Read Write From DB-9 Device Connector to PC USB

Not certain that this fixes any problems, it's just another try: Dim As String resp ' resp = response Dim As Single volt Dim As Long fn = FreeFile, j = 0 Open com "/dev/ttyUSB0:9600,e,7,2,rs,cd,ds,lf,pe" as #fn Sleep 3000 ' delay to let device enumerate Input #fn, resp ' see if we have a r...
by MrSwiss
Jan 14, 2020 23:11
Forum: Hardware Interfaces / Communication
Topic: Serial Read Write From PC USB to HP 34401A meter DB-9[Solved]
Replies: 17
Views: 406

Re: Serial Read Write From DB-9 Device Connector to PC USB

It is not really easy to fix code for a device that one doesn't have for testing. The used protocol is also useful to know (commands, data e.t.c.). As a first try, comment out the lines 5 & 6 of your code because the opening of the COM- Port, can be done in FB-code (alone) and the following dela...
by MrSwiss
Jan 13, 2020 20:24
Forum: Beginners
Topic: Confused about data types [SOLVED].
Replies: 8
Views: 311

Re: Confused about data types [SOLVED].

FB Manual wrote:-vec < level >

Set level of vector optimizations enabled by the compiler (default: 0)

I've never used this: Compiler Option
Dunno, what it is supposed to be good for, anyway. (don't think it's a bug, though)
by MrSwiss
Jan 12, 2020 23:19
Forum: Beginners
Topic: Confused about data types [SOLVED].
Replies: 8
Views: 311

Re: Confused about data types.

I don't find a problem, if compiled with default language (-lang FB)?!?

If you are using another dialect, please specify ...

FB's standard data-types: CatPgStdDataTypes
by MrSwiss
Jan 10, 2020 18:29
Forum: Beginners
Topic: pushing and popping
Replies: 25
Views: 516

Re: pushing and popping

ivory348 wrote:... my questions remain unanswered.

Nobody wants to discuss not working as expected code (aka: buggy code).
(whether it compiles or not, is not the match deciding factor)

Study the codes from fxm/myself and ask again, if there is anything funny there ...
by MrSwiss
Jan 10, 2020 16:06
Forum: Beginners
Topic: pushing and popping
Replies: 25
Views: 516

Re: pushing and popping

Then also: what is the use of all this, in a program, given the existence of arrays. Well, first of all, the concept of push/pop comes from assembly language (not really BASIC). Secondly, at times, examples might not serve any 'real live' purpose, they may only try to explain a coding concept. Thir...
by MrSwiss
Jan 10, 2020 14:40
Forum: Beginners
Topic: pushing and popping
Replies: 25
Views: 516

Re: pushing and popping

But, as stack's typically are of fixed size and work top-down, you could simply define more elements and take it from there (stack's are usually capable of growing "uncontrolled", downwards). Meaning: in real, it might just overwrite other code/data (use with care!) (with user defined arra...
by MrSwiss
Jan 10, 2020 14:28
Forum: Beginners
Topic: pushing and popping
Replies: 25
Views: 516

Re: pushing and popping

Lets take this step by step: dim stack(0)as integer Is a fixed size Array with exactly 1 element (can't be re-sized, at all). Therefore, you'll have no chance of succeeding, right from the start. You need a resizable Array (aka: dynamic Array): ReDim As Integer stack(0) --or-- Dim As...

Go to advanced search