Search found 20 matches

by JaxMusic
Mon Mar 29, 2021 1:07 am
Forum: General Discussion
Topic: "Project Based" learning for PB?
Replies: 12
Views: 4034

Re: "Project Based" learning for PB?

Pretty much what I do, after reviewing the commands, is come up with some little project and then work it out with the materials. This form is also good when you get stuck. You must have some end game in mind for learning Pure Basic, right? Start with something small, like something that logs the ...
by JaxMusic
Fri Mar 12, 2021 11:01 pm
Forum: Coding Questions
Topic: Trouble getting data from SQLite
Replies: 4
Views: 1094

Re: Trouble getting data from SQLite

PartTimeCoder wrote:You are not retrieving the row

try this

Code: Select all

  If DatabaseQuery(1, Sql$,#PB_Database_DynamicCursor) 
    If FirstDatabaseRow(1)
      result=GetDatabaseLong(1, 1)  ;tried both column as 0 and as 1, same result each time
      Debug result 
    EndIf
  EndIf
Yep. I forgot. Thank you.
by JaxMusic
Thu Mar 11, 2021 11:50 pm
Forum: Coding Questions
Topic: Trouble getting data from SQLite
Replies: 4
Views: 1094

Trouble getting data from SQLite

Good evening. I cannot figure out why this code is not returning the correct information. This is a simple procedure to execute a SQL statement and count the number of rows in the database.

1. No errors are thrown when executing the code.
2. The SQL syntax works fine when using a SQLite Studio.
3 ...
by JaxMusic
Thu Mar 04, 2021 3:55 am
Forum: Coding Questions
Topic: Not printing in debug
Replies: 4
Views: 864

Re: Not printing in debug

Tried your code 8 times, debug worked every time. On the rare occasion that I've had strange problems with debug on this machine, it was always with the 64 bit version of pb. Other people may not have any problems though.

Tried the way below, still debugs. I am always using the x86 version of pb ...
by JaxMusic
Thu Mar 04, 2021 2:28 am
Forum: Coding Questions
Topic: Not printing in debug
Replies: 4
Views: 864

Re: Not printing in debug

Hi JaxMusic,

I checked your code. It works.
Please look at Menu Debugger | Use Debugger -- maybe the Menuitem is not checked.

Hint:
I recomment the use of EnableExplicit and Define or Global.
EnableExplicit

Define Sql.s ;SQL string For commands
Global DBName.s ;Database name

I checked ...
by JaxMusic
Wed Mar 03, 2021 11:59 pm
Forum: Coding Questions
Topic: Not printing in debug
Replies: 4
Views: 864

Not printing in debug


Sql.s ;SQL string For commands
DBName.s ;Database name


;Get row count
Sql="Select count(PersonName) As RowCount from Test_names"
DBName="Test.sqlite"
Debug DBName
Debug Sql


Honestly I do not get this. I assign some values to variable, both strings, both declared.
At first, neither ...
by JaxMusic
Mon Mar 01, 2021 6:24 pm
Forum: Coding Questions
Topic: Database interactions
Replies: 6
Views: 1924

Re: Database interactions

Thanks @TI-994A

I understand how it works. I was hoping for a recordset type object. Because there is not one, I will modify my procedures to use a custom data type, make it persist, and return the pointer from within the procedure. Just a bit more work but will solve the problem nicely.
by JaxMusic
Sun Feb 28, 2021 10:27 pm
Forum: Coding Questions
Topic: Database interactions
Replies: 6
Views: 1924

Re: Database interactions

Thanks @Spikey. I had reviewed and tried a lot of that before posting here and you confirmed my suspicions. Not having a Recordset type that is referenced seems like a waste of resources but that’s the breaks. I can work with this “cursor” model but it makes things a bit more cluttered to my way of ...
by JaxMusic
Sun Feb 28, 2021 7:56 pm
Forum: Coding Questions
Topic: Database interactions
Replies: 6
Views: 1924

Database interactions

Good day everyone.

I've been testing some Db functions using SQLite, but my questions would be applicable to any db option.

When using DatabaseQuery, are the records returned in a variable? How do you reference this going forward? For example, I'm wanting to create a procedure that takes the ...
by JaxMusic
Sun Feb 21, 2021 4:09 pm
Forum: Coding Questions
Topic: Remove all duplicate lines from file
Replies: 22
Views: 4826

Re: Remove all duplicate lines from file

Why not drop into a database table? You can easily create a temp table, insert the data, and retrieve the unique list, sorted if you wish:

Select distinct name from tmpname order by name

With Pure Basics DB library, this should be much fewer lines of code and more clear what is being done. Of ...
by JaxMusic
Sun Feb 21, 2021 4:01 pm
Forum: Coding Questions
Topic: Remote to MySQL
Replies: 8
Views: 2209

Re: Remote to MySQL

[quote="TI-994A"][/quote]
Correct me if I’m wrong, I don’t think this would work for your own database without having a script to process the request. This is how it works for public web services. I believe the OP was referring to using a database on a webserver (or any server) instead of using a ...
by JaxMusic
Sun Feb 21, 2021 2:35 am
Forum: Coding Questions
Topic: Remote to MySQL
Replies: 8
Views: 2209

Re: Remote to MySQL

One thing I forgot to mention in my earlier message is that if you are connecting to MySQL on a remote (such as a webserver) is that often you must white list the connecting IP to access the data. If you are using a standard IP, it is dynamic and changes every once in awhile and will need to be ...
by JaxMusic
Sat Feb 20, 2021 5:48 pm
Forum: Coding Questions
Topic: Code Organization
Replies: 7
Views: 1531

Re: Code Organization

[quote="TI-994A"][/quote] thanks for the excellent example TI-994A
by JaxMusic
Sat Feb 20, 2021 5:45 pm
Forum: Coding Questions
Topic: Code Organization
Replies: 7
Views: 1531

Re: Code Organization

Excellent, thanks everyone.
by JaxMusic
Sat Feb 20, 2021 3:32 am
Forum: Coding Questions
Topic: Code Organization
Replies: 7
Views: 1531

Code Organization

Good evening. As I explore Pure Basic I am trying to get a handle on code organization. I see we can have multiple code files in a program and can access them in the IDE, or even organize them in a project. What I don’t see is how you can reference functions in other code (.pb ) files. For example ...