May 07, 2024, 06:08:42 AM

News:

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


Mod Operator

Started by Bill-Bo, December 21, 2012, 10:08:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bill-Bo

LarryMc,

The user manual is very impressive. But, there is one item
I haven't found anything about it so-far; MOD. In a day of the
week program I did in QBasic, it uses 'MOD 7'. Some basics
have gone to using the ' ! ' for MOD, if IWBasic has, I do not
find it in the manual. Now, I have not read the chm file
word-for-word, just the command lists and some sections
I thought is would be. Even did a search.

Your assistance will be most appreciated.

Merry Christmas and have a Happy New Year.

Bill

LarryMc

Quote from: Bill-Bo on December 21, 2012, 10:08:07 AM
LarryMc,

The user manual is very impressive. But, there is one item
I haven't found anything about it so-far; MOD. In a day of the
week program I did in QBasic, it uses 'MOD 7'. Some basics
have gone to using the ' ! ' for MOD, if IWBasic has, I do not
find it in the manual. Now, I have not read the chm file
word-for-word, just the command lists and some sections
I thought is would be. Even did a search.

Your assistance will be most appreciated.

Merry Christmas and have a Happy New Year.

Bill
It's been in there forever.
Look under Language / Operators / Mathematic Operators
The 9th entry in the table is the mod operator %

example
int x=15
print x% 7
prints a 1
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

LarryMc,

I'm getting to old and slow. Turned 66 last week.
I kick myself for not looking further.

Thanks a million.

Bill

P.S. I don't want to waste your valueable time, but
do you know why basics no longer use the command
MOD, and have gone to characters like %, !, etc.?

LarryMc

Have no idea other than the preference of the author.
As far as not finding stuff, I'm 67+ and my mind has been going south for quite some time.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

December 21, 2012, 05:29:56 PM #4 Last Edit: December 22, 2012, 12:31:31 PM by GWS
Bill,

If you really like to see MOD in your program, you could 'roll your own' MOD function :)


openconsole
cls

def i:int

declare MOD(x:int,y:int)

i = MOD(15,7)

print i

do:until inkey$<>""
closeconsole
end

sub MOD(x,y)
def ret:int
ret = x % y
return ret
endsub


Not quite as neat as i = 15 MOD 7, but it works OK ..  ;D

best wishes, :)

Graham

[Edit: Oh heck! I tested this in Creative and all was well.  In IWB I get a page full of 'errors'  :o
Lack of familiarity I suppose.  However, as an IWB man, you'll probably spot what's upsetting it  ::)]
Tomorrow may be too late ..

Bruce Peaslee

Quote from: LarryMc on December 21, 2012, 04:28:44 PM
... I'm 67+ and my mind has been going south for quite some time.
I'm 64. Programming (and crossword puzzles) keep the mind sharp!
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Bill-Bo

December 22, 2012, 11:57:27 AM #6 Last Edit: December 22, 2012, 12:02:01 PM by Bill-Bo
LarryMc & peaslee,

Thanks for the MOD function info. I'll try it.

Isn't that something, I'm a crossword fanatic myself,
but definitely not at a New York Time's level. I also
like varity puzzles. I'm off topic, so I better go.

Thanks All,

Bill

LarryMc

For 5 years while I was in the AF and stationed in the Philippines I worked the crossword puzzle in the Stars and Stripes everyday in ink.
Every morning now I play Pat Sajak's crossword puzzle game Lucky Letters
http://www.patsajakgames.com/games/luckyletters_online.html
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

  5 years; I spent 23 years, 1 month and 28 days, but who's counting. Also,
I had a 15-mo tour at Clark AFB, PI, from Dec '71 to Mar '73. When martial-
law started in '72, out almost 24-hour parting came to a halt.
  I do all my puzzles in ink, even cryptograms. My sister doesn't understand it.
All of her's are in pencil.
  Sorry, but this is the first I heard of Pat Sajak's crossword puzzle game. I'll
have to check that out.
  Thanks for the info.

Regards,

Bill

LarryMc

I was in 10 yrs 10 mos and 2 days
I was at Clark from Jan 68 til Nov 72
When you got there I was living on-base in a new house up behind 13th AF.
I remember when Marcos declared martial law very well.

I worked on autopilots and compass systems of the base flight birds (c47s, c54s, c118s, ch3s, hh43s, h19s, and c9s) plus transient plus F4s.
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

 I was in communication electronics and in the com squadron.
Flew from England to Germany on a C47. Only plane I had been
on that I could see light around the door. A C118 from Camron
Bay back to DaNang.
Out of 14 countries I have been to, I have always rated the PI
the best; then England.
Yeah, martial law was something else. I almost got shot leaving
a bar during curfew. But I got off with 20 Pesos.

GWS

Still looking good ..  :)

Oldies but goodies  ;D

Happy Christmas,

Graham
Tomorrow may be too late ..

LarryMc

Brings back memories.  Numerous times with both engines running I stood under the belly of the plane, in-line with the props with a plumb bob and string.  It was part of the technique we used to calibrate the compass.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

On C47 Skytrains (ya'll called them Dakotas I believe) they had an autopilot system that had no electrical wires.  It was pneumatic over hydraulics.  We'd roll a tall stand up to the nose and raise the top half of the nose like a car hood to work on it.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

Phew, the calibration method sounds a wee bit dangerous with the props running ..  :o

I love those old planes .. lots more character than jets.  I'm just old-fashioned I guess ..

best wishes, :)

Graham
Tomorrow may be too late ..

LarryMc

Quote from: GWS on December 24, 2012, 03:28:22 AM
Phew, the calibration method sounds a wee bit dangerous with the props running ..  :o

I love those old planes .. lots more character than jets.  I'm just old-fashioned I guess ..

best wishes, :)

Graham
Where we calibrated the compasses was way off in the boondocks. The crewchief would taxi the plane and I would ride in the co-pilot's seat. When we got to where we were going I would exit the plane by the rear door and then climb back in that door when we were finished.
On C54s and C118s it was a little different.  I would open the escape hatch over the wing, climb out, and then slide off the wing down the lowered flaps.  Coming back the crewchief would have to come out on the wing also and drop me a rope to get me up over the flaps.

I loved to hear the sound of old prop engines starting.  We had some C124's parked right outside our shop and I really loved to hear them start.
I  just remembered that I use to have to stand in the nose wheelwell of an F4C fighter (right by the engine intakes while they ran one of the engines up so I could check the air pressure on the radar package.(I worked on weapons control radar before I switched to autopilots)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library