Search found 9 matches

by Sirius-2337
Wed Feb 15, 2017 6:24 pm
Forum: Coding Questions
Topic: SB2.0 (Test Version) - Optimize Java Script BUG
Replies: 4
Views: 4815

Re: SB2.0 (Test Version) - Optimize Java Script BUG

Try to leave out the last comma after stepDelay.

Code: Select all

!   stepDelay: 35 ;<-- no comma here
by Sirius-2337
Thu Dec 01, 2016 5:18 pm
Forum: Coding Questions
Topic: How to pass simple variables by reference to a procedure
Replies: 2
Views: 2922

Re: How to pass simple variables by reference to a procedure

This is a limitation of SB.
See here: http://forums.spiderbasic.com/viewtopic.php?f=6&t=556&p=1725&start=2#p1725
and also reported here: http://forums.spiderbasic.com/viewtopic.php?f=6&t=835#p2719

You may try this:
Procedure test(*v.long)
*v\l=1111
EndProcedure

Define v.long

test(@v)

Debug v ...
by Sirius-2337
Sun Oct 30, 2016 12:36 pm
Forum: Coding Questions
Topic: Pointer to variable
Replies: 2
Views: 2951

Re: Pointer to variable

According to Fred this is a limitation of SB ( http://forums.spiderbasic.com/viewtopic.php?f=6&t=556&p=1725&start=2#p1725 )


You could write your code like this:
EnableExplicit

Declare.b callback(*one.Integer)

Define one.Integer

one\i=9876
Debug "Before : "+Str(one\i)
callback(@one)
Debug ...
by Sirius-2337
Fri Oct 14, 2016 3:46 pm
Forum: Feature Requests and Wishlists
Topic: Sgn, Wrap and Constrain...
Replies: 2
Views: 2917

Re: Sgn, Wrap and Constrain...

We already have sgn
Result.f = Sign(Number.f)

Returns a floating-point value representing the sign of the given number.

- Returns 0 if Number is zero.
- Returns 1 if Number is positive.
- Returns -1 if Number is negative.
by Sirius-2337
Wed Sep 14, 2016 5:38 pm
Forum: Coding Questions
Topic: variable 'macro' used inside js inline
Replies: 2
Views: 3135

Re: variable 'macro' used inside js inline

Code: Select all

Macro test(nn)
    !v_#nn = 1;
EndMacro

test(n)
Debug n
by Sirius-2337
Fri Mar 11, 2016 7:41 am
Forum: General Discussion
Topic: SpiderBasic 1.30 final is out !
Replies: 19
Views: 16440

Re: SpiderBasic 1.30 beta 1 is available

Thank you for the many bug fixes!
1.30Beta1 wrote:- Changed: Added a callback parameter to CreateFile()
It's not in the help file yet altough all ohter changes seem to be.
by Sirius-2337
Sun Feb 14, 2016 9:47 am
Forum: Coding Questions
Topic: Pointer to unstructured var
Replies: 5
Views: 5644

Pointer to unstructured var

Can't access a unstructured vars value with pointers

x is 'undefined'
y is ok (96)

Structure Inti
i.i
EndStructure

Procedure Something()

Protected x, y.Inti
Protected *PointerToX.Inti, *PointerToY.Inti

x = 76
y\i = 96

*PointerToX = @x
*PointerToY = @y

Debug *PointerToX\i
Debug ...
by Sirius-2337
Sun Jun 28, 2015 4:23 pm
Forum: Coding Questions
Topic: SaveSomething() = Download
Replies: 2
Views: 3815

SaveSomething() = Download

Is it somehow possible to save anything?

It would be nice if you could use SaveImage() or SaveXML() or similar to save/download user created content.
by Sirius-2337
Sat May 23, 2015 2:23 pm
Forum: Coding Questions
Topic: Linebreak in a TextGadget
Replies: 5
Views: 5563

Re: Linebreak in a TextGadget

HTML uses "<br>" for Line Breaks

If OpenWindow(0, 0, 0, 270, 160, "TextGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(0, 10, 10, 150, 40, "Line 1 " + "<br>" + "Line 2")
EndIf

CompilerIf #PB_Compiler_OS <> #PB_OS_Web
Repeat : Until WaitWindowEvent() = #PB_Event ...