LB Booster
« Search Results »

Welcome Guest. Please Login or Register.
Nov 24th, 2017, 7:16pm


Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
LB Umbrella forum
Liberty BASIC forum (the original)

Search Results

Total results: 10


 1   BASIC code examples / Re: Checking If A File Has Been Updated  on: Today at 4:00pm
Started by Mystic | Post by Mystic
Great info!

I appreciate the assist. The day after Turkey Day is slow at work so it gives me some much needed programming time to tweak my existing code.

Thanks again!!!
 
  Reply Quote Notify of replies

 2   BASIC code examples / Re: Checking If A File Has Been Updated  on: Yesterday at 08:32am
Started by Mystic | Post by Richard Russell
on Yesterday at 06:01am, tsh73 wrote:
You get date and time from FILES command

Just to add that if you need to know which is the newer of two files (rather than simply whether the date/time has changed) this is difficult in LB 4, because the format in which it is returned depends on your locale settings. So for example in the US the date is returned as MDY whereas in the UK it is returned as DMY. There are other regional differences that complicate making a comparison.

In LBB v3.08 I introduced an extension to simplify this: the FILES array has an additional column (4) containing the date/time in a fixed, sortable, format (the date is YMD). So if you don't need your program to be compatible with LB 4, you can use column 4 rather than column 2.

Incidentally the documentation of the FILES statement in the Liberty BASIC help file fails to mention that column 3 contains the file's attributes (read-only, hidden, system, archive).

Richard.
 
  Reply Quote Notify of replies

 3   BASIC code examples / Re: Checking If A File Has Been Updated  on: Yesterday at 06:01am
Started by Mystic | Post by tsh73
You get date and time from FILES command
Code:
fileName$="data.txt"

'create data file
open fileName$ for output as #1
    print #1, "data goes here"
close #1

print "Time stamp for a file ";fileName$
print getFileStamp$(fileName$)


function getFileStamp$(fileName$)
    dim info$(1,1)
    files  DefaultDir$, fileName$, info$()
    if info$(0, 0) = "0" then
        getFileStamp$ = "File not found"
    else
        getFileStamp$ = info$(1, 2)
    end if
end function
 


But you still need a file to store last date/time - to check if date/time had changed.
 
  Reply Quote Notify of replies

 4   BASIC code examples / Checking If A File Has Been Updated  on: Nov 22nd, 2017, 10:15pm
Started by Mystic | Post by Mystic
One of my programs has a data file that it loads when it first runs.

Instead of loading this data file at every pass, it just loads at the start.

If I update the data file I don't want to have to restart the program, so at the moment I just check a separate file with a single "1" or "0" in it to tell the program that a new data file is available.

A little cludgy, so I'd like to remedy this.

I would like to just look at the data file information (i.e. Date & Time) and if it's different than the previous version, reload the new data file.

Make sense?

So the question is, how would I just check if the data file is different than the previous one without actually opening the entire file?

As the program makes it to the top of the pass, it looks at the data file and says, "Oh look, an updated file, I need to load that one."

Thanks in advance...
 
  Reply Quote Notify of replies

 5   General Board / Re: Groupboxes  on: Nov 11th, 2017, 6:02pm
Started by k6dgw | Post by k6dgw
on Nov 11th, 2017, 10:08am, Richard Russell wrote:
Not really. All controls are drawn according to the style/theme currently selected by the user, so the visual appearance will in any case differ between different versions of Windows, different configurations etc. You should not assume that somebody else will see the same thing you do!

LBB sets your program's manifest (assuming you are compiling it to an EXE) so as to select 'Common Controls Version 6.0' which is the last release that still supports the ANSI character set (as opposed to Unicode).

Are you noticing any significant differences between the groupboxes used by LBB and those displayed by other applications?

Richard.


I don't really know, I'm not sure what is being drawn as a groupbox and what comes from other methods in other applications. The boxes and lines in the screens on this forum are much more apparent than in my groupboxes. It's not a big deal, my groupboxes just have very faint outlines that make the groupings hard to see. Thought there might be some sylebit magic. This is Win10 pro, but they're faint on my Win10 home laptop too. Thanks

Fred
 
  Reply Quote Notify of replies

 6   General Board / Re: Groupboxes  on: Nov 11th, 2017, 10:08am
Started by k6dgw | Post by Richard Russell
on Nov 10th, 2017, 11:29pm, k6dgw wrote:
Is there a way in LBB to make the outline around groupboxes wider or heavier?

Not really. All controls are drawn according to the style/theme currently selected by the user, so the visual appearance will in any case differ between different versions of Windows, different configurations etc. You should not assume that somebody else will see the same thing you do!

LBB sets your program's manifest (assuming you are compiling it to an EXE) so as to select 'Common Controls Version 6.0' which is the last release that still supports the ANSI character set (as opposed to Unicode).

Are you noticing any significant differences between the groupboxes used by LBB and those displayed by other applications?

Richard.

 
  Reply Quote Notify of replies

 7   General Board / Groupboxes  on: Nov 10th, 2017, 11:29pm
Started by k6dgw | Post by k6dgw
Is there a way in LBB to make the outline around groupboxes wider or heavier?
 
  Reply Quote Notify of replies

 8   BASIC code examples / Re: Creating HTML and CSS with GOOGLE  on: Nov 7th, 2017, 10:02am
Started by michael | Post by tsh73
Just to say,
after fixing directories, program does work.
 
  Reply Quote Notify of replies

 9   BASIC code examples / Re: Creating HTML and CSS with GOOGLE  on: Nov 6th, 2017, 06:55am
Started by michael | Post by Richard Russell
on Nov 6th, 2017, 04:25am, michael wrote:
You may need to change the directory for the 2 save files to make this work.

It's poor practice to require this. Far better to save the files somewhere that you know will exist on every PC, such as the user's temporary directory. You could use the GetTempPath API or, since this is an LBB forum, get it using some BBC BASIC code:

Code:
    !TempPath$ = @tmp$ 

Quote:
Code:
    navigator$ = "C:\Program Files (x86)\google\chrome\application\chrome.exe" 

Again, rather than specifying a fixed path to a specific application (which may not exist) it would be better to open the file in the user's preferred browser. You could use the ShellExecute API or, more simply, get explorer to do the heavy lifting:

Code:
    navigator$ = "explorer" 

Richard.


 
  Reply Quote Notify of replies

 10   BASIC code examples / Creating HTML and CSS with GOOGLE  on: Nov 6th, 2017, 04:25am
Started by michael | Post by michael
Here is a sample program that builds the HTML and CSS files and displays it with GOOGLE CHROME (HTML 5)

* You may need to change the directory for the 2 save files to make this work.



Code:
print "This program requires a HTML5 compatible browser (USES GOOGLE)"
print " "
print "The HTML file will be  D:\Ants.html"
print " "
print "You may have to change the writing directory for the 2 save files and where google will look"

file$="E:\ants.html" ''<<<<<<<<<<<<<  If you dont have D:\ directory rename to a writable location
open file$ for output as #1
' VVVVVVVVVVVVVVVVVV PUT YOUR HTML5 CODE DOWN HERE VVVVVV
#1 "<!DOCTYPE html>"
#1 "<html lang="+chr$(34)+"en"+chr$(34)+">"
#1 "<head>"
#1 "<meta charset="+chr$(34)+"UTF-8"+chr$(34)+">" ' <<< Keep this section and up for your default template ( it shouldn't need to be changed )
#1 "<title>Story</title>"  '  <<<<<<<<<<<<<<<<< This is the title that will show on the browser section.  
#1 "<link rel="+chr$(34)+"stylesheet"+chr$(34)+" type="+chr$(34)+"text/css"+chr$(34)+" href="+chr$(34)+"style2.css"+chr$(34)+">"
#1 "</head>"
#1 "<body>"
#1 "<header class="+chr$(34)+"banner"+chr$(34)+">"
#1 "<h1>THE STORY OF ANTS</h1>" ' <<<This is the actual title that shows on the web display
#1 "<p> Chapter One --- Page 1</p>"
#1 "</header>"
#1 "<main>"
#1 "<section>"
#1 "<h2>The Solution</h2>" ' <<<<<<<<<<< another sub title. 
#1 "<article>"
#1 "<header>"
' *******************************Your story is bellow this line
' ***  The text sizes are <h1> to <h6>  : This is how I did it :
#1 "<h3>You are digging around for ants.</h3>" 
#1 "<h3>Suddenly the ants start to make strange noises.</h3>"
'******************************** Your story ends
#1 "<nav>" '  ***********************This section is for your interactive link to the next page in your book
#1 "<ul>"
#1 "<li><a href="+chr$(34)+"Page2.html"+chr$(34)+">"+"Next Page</a></li>"
#1 "</ul>"
#1 "</nav>" ' ***********This is the end of your interactive link 
#1 "</header>"
#1 "</article>"
#1 "</main>"
#1 "</body>"
#1 "</html>"
'^^^^^^^^^^^^^^^^^^^^^^^^HTML5 CODE ENDS HERE
close #1
Open "E:\style2.css" for output as #1 '<<<<<<<<CHANGE THE DIRECTORY IF YOU DONT HAVE D:\
'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV PUT YOUR CSS BELLOW THIS LINE VVVVVVVVVVVV
#1 "@charset "+chr$(34)+"UTF-8"+chr$(34)+";"

#1 "article, header, main, nav, section {"
#1 " display: block;"
#1 "}"
#1 "html, body, h1, h2, h3, ul, li, a, p,"
#1 "article, aside, footer, header, main, nav, section {"
#1 " padding: 0;"
#1 "  margin: 0;"
#1 "}"
#1 ".banner {" '***********************define banner
#1 " background-color: rgb(185,165,110);"
#1 "color: white;"
#1 " padding: 10px 20px;"
#1 "}" ' *****************************banner def end
#1 "body {" '*********************** Define body section layout
#1 "width: 960px;"' <<<<make the body 960 pixels wide
#1 "margin-left: auto;"'  << this centers the page
#1 "margin-right: auto;"'<< this centers the page
#1 "background-color: rgb(125,155,180);" ' <<< color
#1 "font-family: Helvetica, Arial, sans-serif;"
#1 "font-size: 15px;"
#1 "}"'****************************body layout ends
#1 "nav {"' ****************** define link layout
#1 "background-color: #330066;"
#1 "padding: 5px;"
#1 "margin-top: 1px;"
#1 "}"'********************** link layout ends
#1 "li a {"'******************* define text color for link
#1 "color: rgb(255,255,255);"
#1 "}"' ********************* text color define ends
#1 "li {"'****Define the location of the link, font, ect
#1 "display: inline;"
#1 "margin-left: 15px;"
#1 "margin-right: 15px;"
#1 "font-size: 20px;"
#1 "font-variant: small-caps;"
#1 "font-weight: bold;"
#1 "}"' **** Link location, font def, ends here
#1 "section {"' ******define section background, spacing 
#1 "background-color: #bbbbbb;"
#1 "margin-top: 10px;"
#1 "padding: 5px;"
#1 "}"' ****define section background, spacing ends here
#1 "article {"'*** Define article background, spacing ect
#1 "background-color: white;"
#1 "margin-top: 5px;"
#1 "padding: 10px 15px;"
#1 "}"'***** define article bkground, spacing ends here
#1 "main {"' **** define the MAIN width and layout **** 
#1 "width: 960px;"
#1 "float: left;"
#1 "margin-bottom: 10px;"
#1 "}"' ********define  Main ends
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CSS CODE ENDS HERE ^^^^^^^^^^^
close #1
navigator$ ="C:\Program Files (x86)\google\chrome\application\chrome.exe"
db$ = navigator$+" "+"E:\ants.html" '<<<<<<<<<<<<<  If you dont have D:\ directory rename to a writable location
run db$  
end

  

 
  Reply Quote Notify of replies


Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls