Author Topic: v1.5 128 bit (and beyond) math *** COMPILER ERROR ***  (Read 59838 times)

0 Members and 1 Guest are viewing this topic.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
It may already have been mentioned elsewhere...

Are there (or could there be statements made) to allow user control on which physical (and/or logical) processor a particular QB64 x64 program will run on Windows 10.

I have a laptop with 4 cores i7 (8 logical processors) and would like to ensure (my option) that multiple instances of QB64 (different) programs run on different processors.

I had 3 different (non-interacting with each other) QB64 programs running and because of the the very slow performance I suspect that all 3 programs were running using the same physical (+logical) processor maybe???

If statements are not (or cannot be) available - would it help to have multiple QB64 x64 installations  eg on C:\ , A:\, D:\ etc and accordingly run each program from a different QB64 installation?

Similarly if I wish to force multiple programs to run on a particular physical/logical processor (where speed is not important) - is this possible to program?

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
You should think long and hard about why you're smarter than the Windows task scheduler.

If you still decide you want to restrict it to running a process on a particular CPU, you can right click the process in Task Manager and Set Affinity.

I doubt you'll get a measurable performance improvement though.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
@luke

Thanks for reply.

I can see the Task Manager > Details > Processor Affinity (All, 0-7 in my case).

Question now  is - can I change this setting in a QB64 program?


I would have hoped that Windows 10 x64 (via Task Manager Scheduler) would do the optimal configuration - however I have noticed progressively (say over a year) that performance has dropped for the same task at hand. I am just guessing that I may regain some performance loss by very specific "tweaking" of where the processes are running.

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setprocessaffinitymask

But I still doubt it'll have a net benefit. You'd probably see more by fiddling with task priority instead.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 Additional Code Select Options (for Forum Reply / New Topic)
« Reply #79 on: October 19, 2020, 07:08:57 am »
It would be useful to have additional options for the Code Select Box - I was thinking of HTML (and others) if this can be made workable in the forum environment.  Although working with HTML would be much more difficult than say just text only or inserting JPG images - it could produce a much better overall appearance.

I checked the SMF forum on this and they mentioned that QB64 site had custom made the Code Select Box (options) and so any additional options would have to be done by QB64 themselves.

I was referenced over to the site below (for the Mods) and it seems that there are some 200 code options available.

https://custom.simplemachines.org/mods/index.php?mod=3070



Quote
Description:
cb|GeSHi= -mod 1.2

cb|GeSHi-mod adds code syntax highlighting = to your forum. Powered by GeSHi, the mod= supports +200 different languages and is fully customizable for each of yo= ur themes.

Compatible with SMF 2.0 and later.

What's = new in 1.2?

- GeSHi sources updated to 1.0.8.11 which inclu= des some new languages
- Minor fix to avoid error notices in the logs wh= en running on PHP 5.4



GNU General Public License v3.0
cb|GeSHi-mod - Syntax Highlighter mod for SMF powered by GeSHi
Cop= yright (C) 2012-2013, codebirth
Website: htt= p://www.codebirth.com

Powered by GeSHi - http://qbnz.com/highlighter/

 
 [ You are not allowed to view this attachment ]  
« Last Edit: October 19, 2020, 07:27:24 am by Richard »

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 IDE Help
« Reply #80 on: October 19, 2020, 07:18:24 am »
As an addition to the information available in the IDE help window...


May be useful to have the equivalent of a "Glossary of Terms" that would assist in the explaining of say problems at hand.

For example (using text representation of a screen) - assigning simple names to the various screens/windows such as IDE window, program window, DOS shell window, etc.


FellippeHeitor

  • Guest
Re: QB64 v1.5 Additional Code Select Options (for Forum Reply / New Topic)
« Reply #81 on: October 19, 2020, 09:23:43 am »
It would be useful to have additional options for the Code Select Box - I was thinking of HTML (and others) if this can be made workable in the forum environment.  Although working with HTML would be much more difficult than say just text only or inserting JPG images - it could produce a much better overall appearance.

I checked the SMF forum on this and they mentioned that QB64 site had custom made the Code Select Box (options) and so any additional options would have to be done by QB64 themselves.

I was referenced over to the site below (for the Mods) and it seems that there are some 200 code options available.

https://custom.simplemachines.org/mods/index.php?mod=3070


  [ You are not allowed to view this attachment ]

Although this seems alien to this topic, let me address your issue.

The HTML support that GeSHi has is for highlighting HTML samples - for showcasing HTML source - not for formatting forum posts with HTML. Although it doesn't show in the Code dropbox when you write a post, you can simply add =html instead of =qb64 when you add a codebox - in case you'll ever need to discuss an html snippet here in the forum.

As an example, a QB64 codebox (which starts with [code=qb64]:
Code: QB64: [Select]
  1. PRINT "Hello, world!"

And an HTML codebox (which starts with [code=html]:
Code: Text: [Select]
  1. <html>
  2.     <head>
  3.         <title>A webpage written in Frontpage - Happy 1998!</title>
  4.     </head>
  5.  
  6.     <body>
  7.         <p>Hello, world!</p>
  8.     </body>
  9. </html>

FellippeHeitor

  • Guest
Re: QB64 v1.5 IDE Help
« Reply #82 on: October 19, 2020, 09:25:00 am »
As fot the feature suggestions, we do read this topic (as well as all others), but the best place for adding feature requests is in the repository, as they are kept in a more organised way (not to mention this is 6 pages long already):

https://github.com/QB64Team/qb64/issues

That's the official way both for feature requests and bug reports.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 IDE Help
« Reply #83 on: November 03, 2020, 09:15:37 pm »
@ Fellippe

Thanks for reply - as suggested by you will place new feature requests in the repository - I did not know (or long time forgotten) about the preferred  place.

Just curious, if you would not mind answering, why even use a repository for features? Apart from you and maybe a few others preferring this (which is fair enough excuse) - I would have thought that say a "Feature Request sub-board in the QB64 forum" would make more sense (to me). I think from the old [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] site at some stage there was a sub-board devoted to this.

Please ignore immediate below

I am practising with html code a little bit for a little while to see if I could ever improve presentation of my replies - it may not work at all for me.

Code: Text: [Select]
  1.  
  2. <html>
  3.     <head>
  4.         <title>Ignore this test html code</title>
  5.     </head>
  6.  
  7.     <body>
  8.         <p>Hello, world!</p>
  9.         A:visited {color: Red ! important }
  10.     </body>
  11. </html>
  12.  
  13.  



A side note:-  I used the new Microsoft EDGE to create this reply and all the "Buttons" (eg Bold, Italic, etc) appear to function as expected. It took about a year or two  for MS to finally address this issue (had to use Windows Internet Explorer previously for the Button use).

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 PRINT USING HEX output (https://github.com/QB64Team/qb64/issues)
« Reply #84 on: November 23, 2020, 05:44:00 pm »
The preferred method for feature requests AND bugs etc is the link below

https://github.com/QB64Team/qb64/issues

Summary

#89   PRINT USING HEX output   by Richard   feature request


Just a thought...

For those using HEX output (rather than decimal) - it would be helpful to have formatting of the HEX output strings, e.g.

FF FF FF FF FF FF FF FF

FFFF,FFFF,FFFF,FFFF

instead of using say MID$ etc to format the output string

'__________________________________________________________________________________________________________________________
.ANSWER to QUIZ "When is 32GByte not equal to 32GByte?

Answer:-  When the definition of Gbyte changes.

e.g.

32 Gbyte of RAM (memory) = 34,359,738.368 bytes
32 Gbyte usb flash memory = 32,008,695,808 bytes (on a usb stick I inspected = 29.8GB)

(Trivial) Programming challenge - write a very simple program to determine TOTAL number of bytes on USB stick (free, used, faulty etc)
       
« Last Edit: December 14, 2020, 11:02:54 pm by Richard »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: QB64 v1.5 PRINT USING HEX output (https://github.com/QB64Team/qb64/issues)
« Reply #85 on: December 14, 2020, 01:15:57 pm »
@Richard

Challenge: Accepted

Code: QB64: [Select]
  1.  
  2. CONST DRIVE_UNKNOWN = 0
  3. CONST DRIVE_NO_ROOT_DIR = 1
  4. CONST DRIVE_REMOVABLE = 2
  5. CONST DRIVE_FIXED = 3
  6. CONST DRIVE_REMOTE = 4
  7. CONST DRIVE_CDROM = 5
  8. CONST DRIVE_RAMDISK = 6
  9.  
  10.     FUNCTION GetDiskFreeSpace% ALIAS GetDiskFreeSpaceExA (lpDirectoryName AS STRING, BYVAL lpFreeBytesAvailableToCaller AS _OFFSET, BYVAL lpTotalNumberOfBytes AS _OFFSET, BYVAL lpTotalNumberOfFreeBytes AS _OFFSET)
  11.     FUNCTION GetDriveType~& ALIAS GetDriveTypeA (lpRootPathName AS STRING)
  12.  
  13. DIM totalFreeBytesOnDisk AS _UNSIGNED _INTEGER64
  14.  
  15. IF GetDiskFreeSpace("L:\", 0, 0, _OFFSET(totalFreeBytesOnDisk)) THEN
  16.     SELECT CASE totalFreeBytesOnDisk
  17.         CASE IS < 1024
  18.             PRINT USING "    ####, B Available"; totalFreeBytesOnDisk,
  19.         CASE IS < (1024 ^ 2) AND totalFreeBytesOnDisk >= 1024
  20.             PRINT USING "####,.## KB Available"; (totalFreeBytesOnDisk / 1024)
  21.         CASE IS < (1024 ^ 3) AND totalFreeBytesOnDisk >= (1024 ^ 2)
  22.             PRINT USING "####,.## MB Available"; (totalFreeBytesOnDisk / (1024 ^ 2))
  23.         CASE IS < (1024 ^ 4) AND totalFreeBytesOnDisk >= (1024 ^ 3)
  24.             PRINT USING "####,.## GB Available"; (totalFreeBytesOnDisk / (1024 ^ 3))
  25.         CASE IS < (1024 ^ 5) AND totalFreeBytesOnDisk >= (1024 ^ 4)
  26.             PRINT USING "####,.## TB Available"; (totalFreeBytesOnDisk / (1024 ^ 4))
  27.     END SELECT
  28.  
  29. SELECT CASE GetDriveType("L:\")
  30.     CASE DRIVE_UNKNOWN
  31.         PRINT "Unkown drive type"
  32.     CASE DRIVE_NO_ROOT_DIR
  33.         PRINT "Invalid path"
  34.     CASE DRIVE_REMOVABLE
  35.         PRINT "Removable media"
  36.     CASE DRIVE_FIXED
  37.         PRINT "Fixed media"
  38.     CASE DRIVE_REMOTE
  39.         PRINT "Network media"
  40.     CASE DRIVE_CDROM
  41.         PRINT "CD-ROM drive"
  42.     CASE DRIVE_RAMDISK
  43.         PRINT "RAM disk"
« Last Edit: December 14, 2020, 01:41:31 pm by SpriggsySpriggs »
Shuwatch!

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 reply to SpriggsySpriggs challenge answer (re bytes free)
« Reply #86 on: January 09, 2021, 10:11:37 am »
@SpriggsySpriggs

Thanks for challenge program answer.

Your program adjusted back down to bytes (rather than GB etc) does give the expected result. I try to do EVERYTHING referring to Bytes (rather than KB etc) to avoid confusion later on due to "rounding errors etc" eg if comparing file sizes. I have read (unofficially) that MS uses a complicated method to convert bytes to KB, some people on the internet report MS is inconsistent in this conversion.

Do you have a list of ALL Kernel32 Dynamic Library FUNCTIONS immediately available for use in QB64 programs - unless I was looking at the wrong link - I don't seem to see FUNCTION GetDiskFreeSpaceExA listed in your API collection (maybe I am misreading everything?)?

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: QB64 v1.5 reply to SpriggsySpriggs challenge answer (re bytes free)
« Reply #87 on: January 09, 2021, 11:47:13 pm »
@Richard I probably don't have it in my API collection. I think I did that function just for your challenge. I can add it, though. I don't have every function from Kernel32 but I occasionally look and find more to add. If you can think of others that you want then let me know
Shuwatch!

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: QB64 v1.5 reply to SpriggsySpriggs challenge answer (re bytes free)
« Reply #88 on: January 10, 2021, 01:50:41 am »
@SpriggsySpriggs

Thanks for reply.

Is it even possible, via API's, to get TotalNumberOfBytes of a drive. I have been looking at the Windows API site and it does not seem to me to be listed as a API function (or equivalently TotalNumberOfUsedBytes, GetDiskTotalSpace, etc)? If so please add to your API collection.

As a special request, I am interested in the API CopyMemory funtion

WindowsAPI>SystemServices>MemoryManagementReference>MemoryManagementFunctions>GeneralMemoryFunctions>CopyMemory

which copies a block of memory from one location to another.

In a new project of mine I wish to copy 1 GByte (if possible) of memory - I do not know if qb64 program can get this copy for use (such as in _MEM) - so I will have to work with the copy via some means outside of QB64.  An API function from you would be nice.  If you can also arrange that this copy is saved to a disk file that would be a plus.


Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: QB64 v1.5 reply to SpriggsySpriggs challenge answer (re bytes free)
« Reply #89 on: January 16, 2021, 05:58:47 pm »
@Richard

I don't know if I'd recommend trying to move around gigabytes of data but here is something that should work. You can see that using CopyMemory I was able to copy the information stored in a string and copy it to a _MEM block and print the information stored to a file.

Code: QB64: [Select]
  1.  
  2. CONST GIGABYTE = 1024 ^ 3
  3.  
  4.     SUB CopyMemory ALIAS RtlCopyMemory (BYVAL Destination AS _OFFSET, BYVAL Source AS _OFFSET, BYVAL length AS _INTEGER64)
  5.  
  6. m = _MEMNEW(GIGABYTE)
  7.  
  8. DIM gig AS STRING * GIGABYTE
  9.  
  10. gig = "Hello, Richard"
  11.  
  12. CopyMemory m.OFFSET, _OFFSET(gig), LEN(gig)
  13.  
  14. OPEN "HelloRichardTest.txt" FOR OUTPUT AS #1
  15. PRINT #1, _MEMGET(m, m.OFFSET, STRING * GIGABYTE)

I don't know what sort of data you are wanting to store with this or whatever but that should at least get you on your way.
Shuwatch!