April 30, 2024, 08:15:43 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Percent symbol

Started by Andy, March 11, 2016, 01:09:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Egil

Quote from: billhsln on March 15, 2016, 08:45:15 AM
Egil, just curious, what anti-virus program do you use?  I am running windows 10 Pro and have no problems with any of the programs I have written.  I use Eset Nod 32 for my Anti-Virus program and have not had that many problems.  Most of the time when I get the big error, it is due to memory problems (like doing a read into a string variable when I should be using ISTRING defined much larger than 255).  I have also run into it when there was a bug in the program.

Bill

I tried Windows 10 Pro, using the Microsoft Live Essentials (same as Microsoft Security Essentials for Windows 7 Pro)  for antivirus protection.
Never had problems with that package when using Windows 7.
The problems I had with win8 and win10, are very common with computers running norwegian language and keyboards. No problems on tablets and smart phones using Windows, but as soon it is used on a regular pc, there are great problems with all programs not sold by Microsoft. 

And still they do not understand why the sales of new operating systems in Norway has dropped more than 75 percent on both Win 8 and Win 10, compared to win 7. Seems it is  difficult for them to understand  that their customers want something that actually works, regardless of who made the program.
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

For the record it works fine on my Win7 Home Premium 64-bit machine compiled in 32 bit mode
And I'm using AVG Free for my anti-virus.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bill-Bo

andy,

It the BaseVer.zip that I did this morning. As in my last post, it would run right in Win 8.1.

I install IWBasic 3.03 on my Win 7 laptop and do my program there. I HATE Win 8.1, and I haven't really heard anyghing great about 10. Another basic I use, QB64, has problems with 10, and lengthy discussions about it. The only reason I don't use my Win 7 laptop much, is a couple years ago, IE and FireFox would no longer connect to the internet.
Even though the Wi-Fi and all that says it is, the two browser will not run. Even after re-installs.

Anyway, I guess it's my other laptop for IWBasic.

I sure appreciate all the help in trying to get this solved.

BTW This is the first program that has done this. Nothing like this, until, andy, you change you subroutine code at the bottom of the program. All previous ones built and ran okay Win 8.1. Win 8.1 must not like that part of the code.

Thanks,

Bill

Andy

March 15, 2016, 11:35:08 PM #28 Last Edit: March 16, 2016, 12:52:38 AM by Andy
Hi Bill,

It is strange that this sub routine should cause you problems.

I made available my StringMap calculator not long ago, although It's only a very basic calculator with +, - *, and / functions, these functions are used to create the new SMMod function like this:

1. I take a decimal number say 88
2. Divide 88 by the base number say 3
3. 88 / 3 = 29.333333333333
4. Because 88 / 3 doesn't go exactly (the .33333333 bit) I do the next steps:
5. I take the 29 part of the answer and multiply it by the base
6. 29 * 3 = 87
7. Now take the original decimal number (88) and subtract the multiplication
8. 88 - 87 = 1
9. 1 is the mod of 88 with base 3.

If the division goes exactly (no decimal point) I return a zero.

I found (point 3) that division was quicker than addition - in other words you can accomplish the same thing by counting how many times you can add 3 to itself before the number is greater than 88 - but on very large numbers say 1,000,000,000,000 you can imagine how long it would take simply adding 3 to itself before the number became greater than 1,000,000,000,000.

What still has me really confused is why the StringMap library works with these functions (+,-,*,/) on your machine but the mod sub routine - which is only a combination of these functions does not.

This is the mod sub routine in the library:

sub SMMod(string SMAStringIn,int SMAStringMod),string  
   SMAstringA = ""
   SMAstringB = ""
   SMAstringC = ""
   SMAstringD = ""
   SMAStringA = "0"

   SMcallfrommod = 1

   if SMAStringMod = 0
      return "Cannot modulate by zero."
   endif  

   SMAstringB = ""
   SMAStringB = SMDivideNumBlockX(SMAStringIn,ltrim$(str$(SMAStringMod)))

if instr(SMAStringB,".")
SMAStringC = mid$(SMAStringB,1,instr(SMAStringB,".")-1)
SMAStringD = SMMultiplyNumBlockX(SMAStringC,ltrim$(str$(SMAStringMod)))
SMAStringA = SMSubNumBlockX(SMAStringIn,SMAStringD)
return SMAStringA
else
return "0"
endif

SMcallfrommod = 0

return "0"
endsub


As you can see I'm simply following the above steps to return the mod.

So, the StringMap functions in use in the mod routine are:

SMDivideNumBlockX - divide a number by another one
SMMultiplyNumBlockX - multiply a number by another one
SMSubNumBlockX - subtract a number from another one

Maybe we will never know why it doesn't work on your machine?

I have attached a version of the ToBase program, here I have put the base conversion program in as a local sub routine - I have removed the StringMap mod function call and replaced it with the built in IWB mod function (%) instead.

It would be interesting to see Bill, if this one works on your machine...

If it does - then I am completely lost as to the problem.
If it does not work - then the problem must be in one of the other functions.

BTW - Bill attached is a small guide to try and get your wifi working (Debug.txt) - it may help - you can always PM me for more help if needed.

Thanks,
Andy.




Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bill-Bo

andy

This worked just fine. BTW I added a couple PRINT statements before the time print out so it'd be two lines down from the result. I will check out the Wi-Fi thing later today or tomorrow.

Thanks very much!!

Bill

Andy

Bill,

Glad that worked for you, so some reason your machine does not my mod sub routine - I may never find out why....

Anyway, good look with your wifi, don't forget you can pm me anytime you need help with it.

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bill-Bo

Andy,

Briefly on the other matter. I tried QtWeb browser (latest is from 2013) and that latest version of Opera. Neither would connect to the internet.

Again, thanks for all the help. And that includes everyone.

Bill

LarryMc

Andy,
Just for kicks try relocating your mod code as early in your library file as possible and see if it makes any difference for Bill.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

March 17, 2016, 12:55:09 AM #33 Last Edit: March 17, 2016, 12:59:50 AM by Andy
Thanks Larry for that idea.

Bill, I have amended the lib file as Larry suggested - if you want to try it then It's attached here.

I have put in three lines in the .iwb file (lines 37, 38, and 39)

The first print line uses the library completely
The second one uses the library completely - but it is a local sub routine
The third is a local sub routine that uses all the library functions except the mod function

Just comment each one in turn to try.

BTW - Bill, download and setup on your machine Malwarebytes (just google it) - on setup untick "try professional version" - install and run it - if it finds anything - tell it to remove  / quarenteen them.

After that, do the same with Superantispyware - let me know how you get on.

Thanks,
Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bill-Bo

Andy

I installed the new lib and inc. It would build, but it's back to the same old problem (00001 for 45 base 2). I tried the three(3) lines individually. None of the three(3) lines printed anything.

The malware stuff, do you mean my Win 7 machine or my Win 8.1?

Bill

Andy

Bill,

I meant for your machine that will not connect to the Internet.

Cannot understand why non of them work. At least the last one should if nothing else, I think something is very wrong on your machine.

All worked for me.  ???

Andy.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bill-Bo

Andy,

I am in the process of restoring my Toshiba 64-bit Vista machine using the recovery disks that came with it. I was luck. I was getting some stuff out of my old house yesterday and found them. I hasn't booted up right in 3 or 4 years. After I get my software back on it, I see what happens there.

Bill

Andy

March 18, 2016, 02:18:57 AM #37 Last Edit: March 18, 2016, 03:03:11 AM by Andy
Bill,

I think that is a good idea about the Vista machine.

My PC can dual boot so I dropped into XP and ran the the versions of the .exe file - this is what I found:

1. The fully native .exe that uses all the StringMap functions for the mod exercise produced an error.

45 to base 2 = 101901 (wrong should be 101101)
45 to base 8 = 50 (wrong should be 55)
45 to base 16 = 2D (correct)

2. The .exe file which used the local sub routine (but all StringMap functions) produced the same results.

3. The .exe file which used all the StrngMap functions except the mod (i.e. replaced with the IWB % command) worked.

So the question is why? and why does it work for me on Win7 32 bit?

My XP is also 32 bit.

I decided to try something...

I added these four istrings to the start of the program

istring SMAstringA[5000]
istring SMAstringB[5000]
istring SMAstringC[5000]
istring SMAstringD[5000]

And then added the StringMap mod routine to the iwb code

sub SMLocalMod(string SMAStringIn,int SMAStringMod),string  
   SMAstringA = ""
   SMAstringB = ""
   SMAstringC = ""
   SMAstringD = ""
   SMAStringA = "0"

   if SMAStringMod = 0
      return "Cannot modulate by zero."
   endif  

   label SMaddupagain
   SMAstringB = ""
   SMAStringB = SMDivideNumBlockX(SMAStringIn,ltrim$(str$(SMAStringMod)))

if instr(SMAStringB,".")
SMAStringC = mid$(SMAStringB,1,instr(SMAStringB,".")-1)
SMAStringD = SMMultiplyNumBlockX(SMAStringC,ltrim$(str$(SMAStringMod)))
SMAStringA = SMSubNumBlockX(SMAStringIn,SMAStringD)
return SMAStringA
else
return "0"
endif

return "0"
endsub


I changed the SMDecToBaseLocal to call this local mod routine

SMii = val(SMLocalMod(SMMyStartValue,SMBaseIn))

and compiled an exe.

Now in XP,
45 to base 2 was correct
45 to base 8 was correct
45 to base 16 incorrect
60 to base 35 doesn't print anything

I have checked that all the routines use individual strings and INT's.

I installed IWB (latest version) in XP, copied all the files needed and then re-built the .lib file (native to XP).

Compiled the base program (native to XP) and now get this...
45 to base 2 correct
45 to base 8 incorrect
45 to base 16 correct
60 to base 35 doesn't print anything

I feel like Alice going down the rabbit hole with this one...

Andy.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Well,

I decided to "upgrade" the laptop (Win7 32 bit) to the new Windows 10 (32 bit) so I could give the library file a go in that.

I found the following:

1. The exe files for the conversion to base (using my library) program works correctly in Win 10.
2. I installed IWB on the laptop, re-created the lib file and exe (in Win 10) - all worked correctly.
3. The lib file tested on the maths functions are running much faster.
4. It took 2.56 minutes to multiply 50 x 50 digits as opposed to nearly 5 minutes.

Bill, it would be interesting to see how you get on in Vista.

Thanks,
Andy.
:)



Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bill-Bo

Andy,

Finally got around this morning to checking things out on the Vista.

First, I did the older ToBase. For 45 base 2 on the 1st run: 121101. On the 2nd and thereafter: 12112B. 60 base 35: 1P, every time it's supposed to.

Second, I did the BaseBill. Same thing happened.

Now, here's something interesting. The BaseBill has a larger base2.iwb than the previous one. I put the previous base2.iwb on the Vista, but did not change the lib and inc from BaseBill. I built it and It runs just fine. What gives?

Bill

Andy

Bill,

Thanks for giving vista a go.

I have access to a vista pc and win 8.1, it will take a couple of days before I can test the program.

All I can say for now is the individual functions of the mod routine (division, addition and subtraction) work okay themselves in XP.

And other functions of the library use these functions together just as the mod function does okay.

I will let you know how I get on when I have the results.

BTW, the basebill.iwb is bigger because it has three sub routines, just for testing purposes.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

March 21, 2016, 08:01:48 AM #41 Last Edit: March 21, 2016, 11:45:43 PM by Andy
Bill,

I tried all variations I could think of on vista home basic 32 bit today.

I even rebuilt the lib file in vista and recompiled the programs.

They all worked correctly.

Only the XP os was out.

As I said before I am on 32 bit systems, Larry stated it was alright for him on win 7 64 bit compiled in 32 bit mode.

So, what "gives", I don't know?

I will continue testing.

Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Today I tested them in win 8.1 32 bit and again everything was okay.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,

I've got a bit lost with the versions - can you post your latest and greatest, please?

Brian

Andy

March 23, 2016, 12:48:43 AM #44 Last Edit: March 23, 2016, 12:53:45 AM by Andy
Brian,

Thanks for replying.

Attached is the latest version (aka basebill.zip posted earlier).

In the base2.iwb you will note lines 37, 38, and 39.

Line 37: (SMDecToBase)
Calls the library SMDecToBase function which in turn uses the following internal lirbray subs -

   SMGreaterThanEquals - checks if one number is >= to another number
   SMGreaterThan - checks if one number is > than another number
   SMDivideNumBlockX - divides one number by another number
   SMMod - returns the mod value


Line 38: (SMDecToBaseLocal)
Calls a local version of the SMDecToBase function and uses (calls) all of the above library functions.

Line 39: (SMDecToBaseLocalIWB)
Is the same as line 38, except it does not use the SMMod function - it is replaced with the standard IWB % command.

Now, with the exception of XP - I have tried Windows Vista, 7, 8.1 and 10 (all 32 bit) and line 37 (call to use the native SMDecToBase library function) returns the correct results.

The base2.iwb in this zip file is larger simply so you can experiment between the three calls - i.e. you can comment / uncomment each line in turn for testing purposes.

I would like it if you could have a go and try the following (and this is what you should get):

45 to base 2 = 101101
45 to base 16 = 2D
60 to base 35 = 1P

Thanks,
Andy.




Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Thanks, Andy,

I will give it a go sometime tonight. For the record, I have Windows 10 64-bit Pro, so anything could happen!

Brian

Bill-Bo

Andy,

Here's what happened on the Win 8.1 lap-top:

 45 to base 2 = 000001 (on the 1st run, 000000 on the 2nd)
 45 to base 16 = 00
 60 to base 35 = 00

On the Vista:

 45 to base 2 = 121101 (on the 1st run, 12112B on the 2nd)
 45 to base 16 = 2D
 60 to base 30 = 1P

Bill

Andy

Bill,

Thanks for keep trying, I just cannot recreate what you get on vista, 7, 8.1, or win 10.

Just waiting for Brian to send his results in.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,

Just tried your code as requested, and can report all three subroutines (in turn)
returned the values you expected

Is that progress for you?

Brian

Andy

March 23, 2016, 09:34:34 PM #49 Last Edit: March 24, 2016, 05:24:33 AM by Andy
Brian,

Thanks for testing the mod function.

You get the same correct results as I do, that leaves me with two puzzles:

1. Why does it not work for Bill?
2. Why does it not work in XP, but works on all other operating systems.

On my old XP system, I noticed I still had EB and IWB2.5 installed as well as IWB3.03 - so I found an old hard drive, installed a fresh copy of XP Pro 32 bit.

Installed IWB3.03 and copied all the files I needed to build the StringMap library in XP - which I did.

Drum roll.... it worked correctly in XP!

Attached are the two builds, I used to compare with  - the Win7 lib build is slightly bigger because I put a few print tracers in (which I have now commented out). The Win7 build project produces a String7.lib file which I renamed and I also amended the inc file $use line to match.

Both .exe files (one in each zip file) should produce correct results.

So the XP problem I had was my fault - as I believe you should only have one copy of IWB installed - but I only use XP so infrequently now - I clean forgot about the other EB / IWB versions being there.

That leaves me with the one remaining puzzle - why is Bill not getting correct results when the rest of us are?

Bill - I hope you don't get too fed up with this, as you can see I'm working hard to find ananswer to the above question.

BTW - I started all this around 6am (having woken up at "silly o'clock" - 4.30), It's now about 12:30 - that was some testing!!

Thanks,
Andy.



Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.