home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
ST_NEWS
/
STN_02_5.MSA
/
DATA_DOC37
< prev
next >
Wrap
Text File
|
1987-07-23
|
3KB
|
121 lines
üRSCהILESחNוFAאASIC Çbyפobertזeessels,צtrike-a-Lightצoftware
Hello∙ouµreaks∩ut⌠here!
Let'sΦaveβ≤hortΘntroductionµirst.לy∈ameΘsפobertזeessels.
Iβmβ≡rogrammer,⇩and≈orkβt⌠heגutch≤oftwarehouse⇩STRIKE-a-
LIGHT≤oftware¿inµactח'm∩ne∩f⌠he∩wners∩f⌠hisπompany).⇩I
work⇩on⇩the⇩ST⇩now⇩for∩neβnd⇩a⇩half⇩year.⇩Most⇩of⇩the
programming⇩IΣoΘsΣoneΘnוfAΓasic.⇩All≥outines⌠hat⇩should
run⇩fast⇩I⇩write⇩in≡ure⇩assembler⇩using⇩Profimat.⇩For⇩my
resources,ח⌡seי-Resource,∩rπreate⌠hemϕyselfµromוfAΓasic.
All≥ight,∈ow∮et's≤tart.
On⇩theΣisk∙ou'llµindβוfAΓasic≡rogramπalled⇩RESOURCE.BAS,
and⌠he≥esourceµileפESOURCE.RSC.קryβndσxamine⌠he≡rogram⌠o
learn⌡sing≥esources.
TheצTΦas≤ome≤tandardΓuiltΘn≥outines,≈hichπan⌠akeπare∩f
theΘnteractivityΓetween⌡serβndπomputer.דxamplesβre⌠he≈ell
knownϕenuΓar,βlertΓoxes∩rµorms.קheseβreβllΣescribedΘnβ
soπalled≥esource.
So,⇩a⇩resourceΘsβ≡ile∩fΘnformationΣescribing⇩things⇩like
menu⇩barsβndµorms.⇩A≥esourceΘs⌡suallyϕade≈ithβ⇩resource
construction⇩set⇩likeי-Resource.⇩The≥esourceµile⇩is⇩called
*.RSC.
A⇩resource⇩isΓuilt⌡pΓy∩bjects.⇩An∩bjectΘsµor⇩example⇩a
string,⇩a⇩box⇩orβnΘcon.⇩Byπombining∮oose∩bjects⇩you⇩can
createβ≥esourceµile.
I≈ill∈owσxplainΦow⌠oϕakeβµorm.
Start≈ith≡uttingβµorm¿aΓigΓox)Θn⌠heπreation≈indow.⇩You
nowΦaveβ≥ectangleΘn≈hich∙ouπan∩rganize∙our⇩objects.⇩You
can≡utβnנKΓoxΘnΘt,⇩anΘcon,⇩anσditable⌠ext¿the⌡serπan
typeΘn≤omeΘnformation),⇩etc.⇩When⌠heµorm∮ooks∮ike⌠he≈ay
you≈antΘt⌠o,∙ouπan≤aveβ≥esourceµileπontaining⌠heµorm.
Now∙ouϕustϕerge⌠he≥esourceΘn∙our≡rogram.
If⇩youΦaveτivenσach∩bjectβ∈ame,⇩youπanτetβ∮ist∩f⇩the
names⇩and∈umbers∩f⌠he∩bjectΓyϕerging⌠he¬.Hµile⇩to⇩your
program.
At⌠he≤tart∩f⌠he≡rogram∙ouϕust∮oad⌠he≥esourceµile:
N$="*.RSC"+Chr$(0)
LpokeIJddrin,Varptr(N$)
Gemsysõ10
Theτemsys⌠akesπare∩f∮oading⌠he≥esourceµileΘnµreeϕemory.
Now∙ouϕustτet⌠he≤tartβdress∩f⌠he≥esource:
Dpokeוintin,0
Dpokeוintin+2,0
Gemsysõ12
Tree%=Lpeek(Addrout)
Now⇩the÷ariableקree%πontains⌠heβdressβt≈hich⌠he⇩resource
is∮ocatedΘnϕemory.
Now∙ouΦave⌠oπenter⌠heµormΘn⌠he≤creen:
LpokeIJddrin,Tree%
GemsysŒ4
Now⌠he≈holeµormΘs≥eadyµor⌡se.
YouπanΣraw⌠heµorm∩n⌠he≤creen:
LpokeIJddrin,Tree%
Dpokeוintin,0
Dpokeוintin+2,7
Dpokeוintin+4,0
Dpokeוintin+6,0
Dpokeוintin+8,640
Dpokeוintin+10,400
Gemsysœ2
By⌠hisτemsys⌠heµormΘs∩nlyΣrawn⌠o⌠he≤creen.⇩Nothingσlse
isΣone≈ithΘt.
Youπanβctivate⌠heµorm:
LpokeIJddrin,Tree%
Dpokeוintin,-1⇦(or⌠he∩bject∈umber≈hichΘsσditable)
GemsysŒ0
NowוEM⌠akes∩ver⌡ntil⌠he⌡serπlicks∩nβ⌠ouchexit∩rβnσxit
box.IJfter≤uchβΓoxΘs≤electedΓasic⌠akes∩verβgain.
Youπan∩btain⌠he∈umber∩f⌠he≤electedΓox:
Out%=Dpeek(Gintout)
The÷ariableנut%∈owπontains⌠he∩bject∈umber.⇩In⌠he∮ist∙ou
merged⇩to⇩your≡rogram∙ouπanµind⌠he∈ameΓelonging⇩to⇩that
number.
Ifβn∩bjectΘs≤electedΘsΘsβutomaticallyΘnverted.ךouπan≥e-
invertΘt:
Dpokeקree%+Out%*24+10,Dpeek(Tree%+Out%*24+10)IJnd¿65534)
Now∙ouπanΣo≤omethingβsβ≥eaction⌠o⌠he≤elected∩bject,βnd
the≥edrawβnd≥eactivate⌠heµormβgain.
All⌠his∮ooks≡robably≥atherΣifficult⌠o∙ou,⇩butחβssure∙ou
itt⇩isΘnµact±uiteσasy.⇩ItΘs⌠houghβΓitΦard⌠o⇩learn⇩it
fromβ⌠extµile.
You⇩can∈owΓetter∮oadוfAΓasicβn⌠ry⌠he≡rogramח⇩mentioned
above.⇩After⇩a⇩bit⇩playing≈ith⌠he≡rogram⇩I'm⇩sure⇩you'll
understandΘt.
I≈ish∙ouτood∮uckΘn⌠he≈orld∩fוEM.
Youπan≥eachϕeβt:
STRIKE-a-LIGHT≤oftware
Robertזeessels
GroteאergÕ5
5611יJ⇩Eindhoven
Theמetherlands.