Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - John

Pages: [1] 2 3 ... 25
1
Code and examples / Re: XML Parser
« on: 18. August 2017, 08:02:20 »
I'm curious what web development interest is here on the forum? It seems Windows desktop is where BASIC calls home.


2
Offtopic / Re: ProBoards
« on: 14. August 2017, 18:29:36 »
Quote
What does "draining your cookie file" mean?

Brute force method of returning the contents of you browser cookie file. Didn't you find it strange seeing ads popping up based on sites you visited?

3
Offtopic / Re: ProBoards
« on: 14. August 2017, 02:43:25 »
Besides the ads ProBoards floods you with, they put your PC to its knees draining your cookie file.

4
Code and examples / Re: XML Parser
« on: 13. August 2017, 10:33:01 »
Here is an example of transforming the QuickBooks Online Apps Directory to a simple table list using the Script BASIC application proxy server.

Code: [Select]
' QBO Apps List

IMPORT cgi.bas
IMPORT curl.bas

ch = curl::init()
curl::option(ch,"URL","https://appcenter.intuit.com/allapps")
apps_html = curl::perform(ch)
curl::finish(ch)

cgi::Header 200,"text/html"
cgi::FinishHeader

PRINT """
<html>
<body>
<table>
<center><h1>QBO Apps Listing</h1></center>
<table style="width:100%">
  <tr>
    <th>App Name</th>
    <th>Vendor</th>
    <th>Description</th>
  </tr>
"""

SPLITA apps_html BY "<!-- this is for SEO crawlers -->" TO apps_array

FOR x = 0 TO UBOUND(apps_array)
  IF apps_array[x] LIKE """*<div class="bigappcard-display-name">*</div>*<div class="bigappcard-vendor-name">*</div>*<div class="bigappcard-tagline">*</div>*""" THEN
    PRINT "  <tr>\n"
    PRINT "    <td>",TRIM(joker(2)),"</td>\n"
    PRINT "    <td>",MID(TRIM(joker(4)),4),"</td>\n"
    PRINT "    <td>",TRIM(joker(6)),"</td>\n"
    PRINT "  </tr>\n"
  END IF
NEXT
PRINT """
</table>
</body>
</html>
"""



5
Offtopic / Re: WhatA Fu** they...
« on: 06. August 2017, 22:29:26 »
Dave's VB6 based Script BASIC IDE/Debugger for Windows is pretty sweet. My goal is to convert it to IUP so it's cross platform.

6
Offtopic / Re: WhatA Fu** they...
« on: 06. August 2017, 06:42:56 »
Sure John, GCC is fine but nobody really uses it with an IDE these days (unless you're staunchly an OSS proponent) simply because they come with their own compiler built-in.

I only use the console, gcc and the C BASIC preprocessor to compile Script BASIC and its extensions on an OS platform. (Windows, Linux, Android, ...)

7
Offtopic / Re: WhatA Fu** they...
« on: 05. August 2017, 06:56:56 »
Doesn't anyone like gcc?




8
Code and examples / Re: DJPeter Math Solver in o2
« on: 27. July 2017, 07:39:04 »
I cleaned up the Script BASIC EVAL function to make it more traditional.

Code: [Select]
IMPORT sbt.sbi

FUNCTION EVAL(expcode)
 sb = SB_New()
 SB_LoadStr(sb, "result = " & expcode)
 SB_Run(sb, "")
 EVAL = SB_GetVar(sb, "main::result")
 SB_Destroy(sb)
END FUNCTION

PRINT EVAL("2 ^ 4"),"\n"
PRINT EVAL("(10 + 6) / 4"),"\n"
PRINT FORMAT("%.3f",EVAL("SQR(3)")),"\n"
PRINT EVAL("""\"Hello " & "World\""""),"\n"

EVAL("""0
FOR x = 1 TO 5
   PRINT x,"\\n"
NEXT""")


jrs@jrs-laptop:~/sb/examples/test$ time scriba eval.sb
16
4
1.732
Hello World
1
2
3
4
5

real   0m0.009s
user   0m0.008s
sys   0m0.004s
jrs@jrs-laptop:~/sb/examples/test$





9
Great to have you back Mike!

Your input is always appreciated.


10
Why has BASIC programming turned into a lets redefine the wheel again? Doesn't anyone like BASIC programming anymore? Is creating BASIC like interpreters what BASIC is all about?

Can you imagine 100 variations of QB or VB?

11
Code and examples / Re: DJPeter Math Solver in o2
« on: 23. July 2017, 22:31:26 »
Paul,

It was just a quick & dirty EVAL example showing the threading feature of Script BASIC. I'm sure a smarter EVAL() function could be assembled.

result was just a variable I used. It could have been A. The expression could have been a complete multi-line program. 

12
Code and examples / Re: DJPeter Math Solver in o2
« on: 22. July 2017, 21:46:34 »
Here is an example of Script BASIC's EVAL() function.

Code: [Select]
IMPORT sbt.sbi

FUNCTION EVAL(expcode)
 sb = SB_New()
 SB_LoadStr(sb, expcode)
 SB_Run(sb, "")
 EVAL = SB_GetVar(sb, "main::result")
 SB_Destroy(sb)
END FUNCTION

expression = "result = 2 ^ 4"

PRINT EVAL(expression),"\n"


jrs@jrs-laptop:~/sb/examples/test$ time scriba eval.sb
16

real   0m0.009s
user   0m0.008s
sys   0m0.004s
jrs@jrs-laptop:~/sb/examples/test$






13
Code and examples / Re: DJPeter Math Solver in o2
« on: 19. July 2017, 11:20:23 »
Business BASIC has had EXECUTE("a = 1 + 1") for as long as I can remember. (1980 ->)

Script BASIC executes its dynamic string code in a thread.



14
Code and examples / Re: XML Parser
« on: 10. July 2017, 18:15:21 »
To get back on topic, I feel the Script BASIC SPLITA and LIKE combo makes for a great lightweight XML parsing solution. My next goal is to get this to work with JSON.

15
Code and examples / Re: XML Parser
« on: 09. July 2017, 23:45:20 »
Maybe not a good analogy but I don't think anyone would be interested in a Btrieve like file system these days.

Pages: [1] 2 3 ... 25