December 12, 2019, 01:37:37 am

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Recent posts

Pages 1 2 3 4 ... 10
11
Trouble Registering? / CBasic registration
Last post by flottero - December 07, 2019, 07:33:42 am
Hello

I make my donation for CBasic, and receive the code, I insert the code, and then
it be recognized as valid, but when I restart CBasic it result as trial as well.
where is the problem ?

thanks

Fabio
12
General IWLP Discussion / Re: Need input
Last post by Andy - December 06, 2019, 05:28:20 am
Hi,

Yes, I have used Print Buffer in the past, so anything you can do to make it more secure would be a big help to us all.

Andy.
13
General IWLP Discussion / Re: Need input
Last post by LarryMc - December 05, 2019, 07:18:54 pm
Quote from: ckoehn on December 05, 2019, 06:40:48 amI hate to slow you down because I am anxiously awaiting the new compiler, but I think it would be advantageous to make it as secure as possible.  Just my thoughts.

Later,
Clint

I agree with Clint.
14
General IWLP Discussion / Re: Need input
Last post by ckoehn - December 05, 2019, 06:40:48 am
I hate to slow you down because I am anxiously awaiting the new compiler, but I think it would be advantageous to make it as secure as possible.  Just my thoughts.

Later,
Clint
15
General IWLP Discussion / Need input
Last post by Rock Ridge Farm (Larry) - December 05, 2019, 06:00:06 am
While working on the new compiler I discovered a security bug - I think.
When using the print statement:
    print "hello"
    buffer = "hi there"
    print buffer
The statement 'print buffer' is a hack point.
warning: format string is not a string literal
      (potentially insecure)

Now my question to the members:
Do many people use the format "print buffer".
1. Should I just provide the above security warning at compile time?
2. Should I disallow the use of that format?

I do have a possible fix by changing the produced bytecode but it is a bit involved.

Anyway just thinking - opinions???

Larry

 
16
General Questions / Re: Adding menu items
Last post by Andy - December 05, 2019, 04:52:03 am
Thanks,

That's one way of doing it, will have a look!

Andy.
 :)
17
General Questions / Re: Adding menu items
Last post by fasecero - December 04, 2019, 03:23:55 pm
You can implement something like this

Code Select
CONST toolbaseID = 100 ' tool starting number/id
INT toolCount = 0 ' menuitems tools number you currently have

increase toolCount by 1 each time a new tool is added and call

Code Select
ADDMENUITEM (w1, 1, "new tool", 0, toolBaseID + toolCount)
when you save the tools to a file, save toolCount too.
18
Console Programs / Square Root by Iteration Metho...
Last post by GWS - December 04, 2019, 01:08:50 pm
Here's another oldie which is probably not really needed these days. :)

We have an inbuilt SQRT() function which is probably faster and more accurate.

However, it's interesting to see how the iteration is used.

Note that it needs Double precision to work correctly ..

Code Select
' Square Root by Iteration ..
openconsole
cls
' Calculating a Square Root using Iteration ..

def x,y,z:double
def i:int

setprecision 10

print

' Example:
z = 27 :' positive real number whose Square root is required

print
print "Square Root of ",z:print:print STRING$(30, "_" )
print:print:print "Iterations: ":print

x = z/2 :' arbitrary start value for the iteration

do
x = 0.5 * (x + z/x)
print x
until ((x*x - z)/z <= 1.e-11) :' the test for convergence

print
print "The Square Root of ",z, " is  ", x

' Compare with the inbuilt Sqrt() function ..
print:print
print "Using the CB Sqrt() Function, the result is .. ":print
print sqrt(z)
print:print STRING$(30, "_" )

do:until inkey$<>""
closeconsole
end


Best wishes, :)

Graham

19
Console Programs / Re: Polynomial evaluation
Last post by billhsln - December 04, 2019, 12:48:49 pm
Just FYI, I work on an iSeries (AS/400) machine, where I program in RPG and COBOL.  Both languages are still alive and running.  RPG was Report Program Generator, but now it is used like we used to use COBOL/CICS.  It has green screen entry screens, to enter data into and respond back from and will do batch report processing and file manipulation.  It also allows access to DB2 to use SQL.

Bill
20
Console Programs / Re: Polynomial evaluation
Last post by GWS - December 04, 2019, 11:30:02 am
Hi Larry,

A stack of punched cards had to be carried with care - if you dropped them, your program statements could be shuffled.  ;D

Best wishes, :)

Graham
Pages 1 2 3 4 ... 10