Compiled PRINT_USING

Anything QL Software or Programming Related.
User avatar
Tesla
ROM Dongle
Posts: 17
Joined: Fri Sep 15, 2017 6:19 pm

Compiled PRINT_USING

Postby Tesla » Tue Sep 25, 2018 9:58 pm

Hi to all.

In a program of mine, I use the command PRINT_USING of toolkit II to display big money as 1.2E7 through the mask "###,###,###,". In the interpreted version of the program the PRINT_USING shows correctly 12.000.000, but in the turbo compiled version the PRINT_USING shows 120.000.
I put the mask in a variable masc$ and I call the priint using by PRINT_USING (masc$,money) where money=1.2E7
I dont understand what is the matter. Any ideas?

Thanks for the help


martyn_hill
Gold Card
Posts: 433
Joined: Sat Oct 25, 2014 9:53 am

Re: Compiled PRINT_USING

Postby martyn_hill » Tue Sep 25, 2018 10:20 pm

Hi Tesla

I just tried your example on QPC and it works identically in both SBasic and a Turbo'd job - giving the expected "12.000.000" output

Are you testing this on a real QL or other platform? If so, I can play around tomorrow and test again on my BBQL.

I've come across some oddities in my own Turbo compiled jobs in the past, but usually it comes down to my earlier misunderstanding of how Turbo 'optimises' expressions in a way that uncooked SuperBasic doesn't. That doesn't sound relevant here, however.


User avatar
Tesla
ROM Dongle
Posts: 17
Joined: Fri Sep 15, 2017 6:19 pm

Re: Compiled PRINT_USING

Postby Tesla » Tue Sep 25, 2018 11:26 pm

Martyn_hill wrote
I just tried your example on QPC and it works identically in both SBasic and a Turbo'd job - giving the expected "12.000.000" output

Are you testing this on a real QL or other platform? If so, I can play around tomorrow and test again on my BBQL.


I got this problem on my real QL with Gold Card, Qubide and Superhermes. Really the problem doesn't show at every call of the print_using, just to complicate things, but always appears when numbers are printed in column. Maybe it can depend by PRINT_USING spacing mechanism.
Thanks for your help


User avatar
Tesla
ROM Dongle
Posts: 17
Joined: Fri Sep 15, 2017 6:19 pm

Re: Compiled PRINT_USING

Postby Tesla » Tue Sep 25, 2018 11:31 pm

OOPS!
I forgiven the most important thing: MInerva rom 1.98 from Tetroid rom switcher, but the problem happened also with my old Minerva. This make me thinking to try with js rom, but I think this is not the problem.

Ciao


martyn_hill
Gold Card
Posts: 433
Joined: Sat Oct 25, 2014 9:53 am

Re: Compiled PRINT_USING

Postby martyn_hill » Tue Sep 25, 2018 11:33 pm

Hi again Tesla

Do you have a more fleshed-out code example showing how you are producing the column format?

Buonasera.


User avatar
Tesla
ROM Dongle
Posts: 17
Joined: Fri Sep 15, 2017 6:19 pm

Re: Compiled PRINT_USING

Postby Tesla » Wed Sep 26, 2018 6:50 pm

Interpreted.jpg
Print_using interpreted
Ok these are the images. It is an old program, a football manager like that I made several years ago. It is a kind of clone of the original game for the Spectrum. Unlike other clones it has the animatione of the match (like the original) based on gigabasic sprites. It is focused on italian championship. I am making some restyling and is my wish to post it here on the forum in english language. In the previous versions the print using was not present.
Compiled.jpg
Print_using compiled


Today it came in my mind that the reason coul be in the way the program saves data. I will investigate this matter.

Hi to all


martyn_hill
Gold Card
Posts: 433
Joined: Sat Oct 25, 2014 9:53 am

Re: Compiled PRINT_USING

Postby martyn_hill » Wed Sep 26, 2018 9:08 pm

I see, Tesla - looks fun!

Feel free to share a code-example that prints the entire line including the use of PRINT_USING - I'm wondering if the use of print separators (TO , ; etc) is handled differently under Turbo.

M.



Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 1 guest