World of Spectrum
  • Categories
  • Discussions
  • FAQ
  • Sign In
Home › Search
Title Search
@title beer Word 'beer' in title
User Search
  • @user admin Only posts by Admin
Text Search
  • @body beer Word 'beer' in the text
Phrase Search
"Hello World" Exact phrase match
Exclude Terms
  • car -red Search cars that are not red
"Or" Searches
  • honda | bmw 'honda' or 'bmw' results
Multi-Field
@(title,body) hello Both contain 'hello'
WildCard
  • hond* civ* Match all with an astrix
Combination
  • @title bmw @user admin
See more supported syntax examples
Search Again :: Adv Search 898 results in 0.002s
<1…14151617181920…30>
  • Procrustean PrintingHere's a short routine to manage printing of text with command tokens, to avoid messing up the screen when they are expanded. It just prints as many …

    ... editor printed a function; eg. "FN d(2,0)
    Dunny Dunny December 2011 Sinclair Basic
  • Procrustean PrintingHere's a short routine to manage printing of text with command tokens, to avoid messing up the screen when they are expanded. It just prints as many …

    ... - no spaces either side
    FN to BIN - trailing space
    Battle Bunny Battle Bunny December 2011 Sinclair Basic
  • Can someone shorten this line of BASIC for me?I think if Sinclair Basic had a modulo operation this line could be a lot shorter:[CODE]PRINT AT cy,cx; PAPER 7-((cx/2=INT (cx/2))*(cy/2=INT (cy/2)))…

    This produces a similar result:
    [code]
    DEF FN c(x,y,c)=ABS ((x/2=INT (x/2))-c)*ABS ((y/2=INT (y/2))-c)

    PRINT AT cy,cx; PAPER 7-FN c(cx,cy,1)-FN c(cx,cy,0);" "
    [/code]
    Battle Bunny Battle Bunny January 2012 Sinclair Basic
  • problem with RND (or maybe INT)I'm using this statement: LET m=(INT (RND*sn)+k1)*k2-k1 to give a pointer m to a 2-byte segment of a string l$. Items k1 & k2 are integer constants…

    ... +k1)*k2-k1: LET co=FN s(l$(m TO m ... htkA THEN
    LET hk=FN a(ht): LET hp=-k1 ... LET p$="Give "+STR$ hp+" "+(FN c$(co)(TO k2))+"?": LET ...
    Battle Bunny Battle Bunny January 2012 Sinclair Basic
  • House of Hell gamebook conversionAs there's potentially several people working on this I thought that I'd set up a thread in the correct section, rather than it continuing in Wanted …

    ... /> * # check value of Reqs; eg. #=FN d(1,0) if Reqs ... value to unit Type; eg. $=FN d(1,6) unit Type ... of unit Type; eg. %>=FN d(2,0) if unit ...
    Battle Bunny Battle Bunny January 2012 New game ideas
  • The curious case of the vanishing zerosRight, I'm back for more help guys This time I think I've figured out the code ok....but still it fails - well it works but only once... Basically …

    ... problem with BASIC functions (DEF FN).

    [B][Edit] [/B ...
    Paddy Coleman Paddy Coleman January 2012 Sinclair Basic
  • DATA vs PRINT and OVERjust messing about and came across this alternative way of drawing a map....now before I start mucking about with my actual program.....is there any …

    ... the DATA and using a DEFADD (PEEK 23563+256*PEEK 23564 ... quicker, as the ROM checks DEFADD for variables before it checks ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Generating a constant of 2?Hi Folks, Through "The Wizard of WOS" I learnt that you can generate constants as follows: [B]NOT PI=0 SGN PI=1 INT PI=3[/B] Is there a quick way …

    ... by defining:
    DEF FN c()=VAL "FN p(23621)"
    and ... ... IF (error) THEN GO TO FN c()
    which jumps back ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Generating a constant of 2?Hi Folks, Through "The Wizard of WOS" I learnt that you can generate constants as follows: [B]NOT PI=0 SGN PI=1 INT PI=3[/B] Is there a quick way …

    ... by defining:
    DEF FN c()=VAL "FN p(23621)"
    and ... ... IF (error) THEN GO TO FN c()
    [/QUOTE]

    Paddy Coleman Paddy Coleman February 2012 Sinclair Basic
  • Generating a constant of 2?Hi Folks, Through "The Wizard of WOS" I learnt that you can generate constants as follows: [B]NOT PI=0 SGN PI=1 INT PI=3[/B] Is there a quick way …

    ... ]
    9200 LET s=VAL "FN p(23627)-24": LET p ... =FN p(s):
    FOR a= ... s TO VAL "FN p(23627)-4" STEP VAL ... "2":
    LET d=FN p(a): PRINT d,"+";d ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • stuck on recursive functionI want this function to PEEK 'l' bytes from memory starting at 's' and return them as a string, but however much I fiddle about with quoting and pare…

    Flip, I've gone and done it now.

    DEF FN j$(s,l)=CHR$ PEEK (s)+VAL$ (("FN j$("+STR$ (s+1)+","+STR$ (l-1)+")" and l>1)+("""""" AND l=1))

    Seems a bit long, though.
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • stuck on recursive functionI want this function to PEEK 'l' bytes from memory starting at 's' and return them as a string, but however much I fiddle about with quoting and pare…

    ... ,l)=CHR$ PEEK (s)+VAL$ (("FN j$("+STR$ (s+1)+","+STR ... =1 then the first part ("FN j$...") will return an empty ...
    Dunny Dunny February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... ;525373]No need to set DEFADD back to 0!
    Also ...
    Paddy Coleman Paddy Coleman February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... AEDCB form used by DEF FN and the calculator; the 14 ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... name. In addition, as DEF FN parameters can only have single ... be '0' in a DEF FN string variable; putting in a ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... memory anywhere as long as DEFADD points to that address? If ...
    Paddy Coleman Paddy Coleman February 2012 Sinclair Basic
  • RND numberHow do I go about selecting from the numbers 4,9,14 and 19? (RND*4)*5-1 ????? :-?

    ... ,99,405:
    DEF FN a(a$)=FN b(a$,1+INT ... a$/3))*3):
    DEF FN b(a$,r)=VAL a ... r+2)
    LET a=FN a("005019022084207099405")
    which will ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • Poking a string to memory...I'm looking to poke a string of characters including colour control codes to memory, I'm currently doing it by hand: 16,2,19,1,22,1,1,144 That equa…

    Looks like another job for the DEFADD trick. I'll leave PC to answer this one, as I haven't had my breakfast yet, and there might be a simpler method which a lack of Cheerios is concealing from me.
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • RND numberHow do I go about selecting from the numbers 4,9,14 and 19? (RND*4)*5-1 ????? :-?

    ... ,99,405:
    DEF FN a(a$)=FN b(a$,1+INT ... a$/3))*3):
    DEF FN b(a$,r)=VAL a ... r+2)
    LET a=FN a("005019022084207099405")
    which will ... may have problems with DEF FN so beware.

    Paddy
    Paddy Coleman Paddy Coleman March 2012 Sinclair Basic
  • Poking a string to memory...I'm looking to poke a string of characters including colour control codes to memory, I'm currently doing it by hand: 16,2,19,1,22,1,1,144 That equa…

    ... /> The four bytes in the DEFADD area used for the location ... 50000 of 1000 bytes the DEFADD workspace values would be:
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • Reading interface 2 using the IN commandHow do you read using the IN command from BASIC? You can read multiple keys at once, but I cant remember the values...

    ... a value.

    FN b(n,w) takes n ... />
    [code]10 DEF FN b(n,w)=1 AND ... br /> 50 LET down=NOT FN b(t,4): PRINT (" ... br /> 60 LET left=NOT FN b(t,16): PRINT ("LEFT ... br /> 70 LET right=NOT FN b(t,8): PRINT ("RIGHT ... br /> 80 LET fire=NOT FN b(t,1): PRINT (" ...
    mcleod_ideafix mcleod_ideafix March 2012 Sinclair Basic
  • Reading interface 2 using the IN commandHow do you read using the IN command from BASIC? You can read multiple keys at once, but I cant remember the values...

    Oh dear, 'bits' and the DEF FN command are not my strong points! :confused:

    Reading 61438 should do the trick, how do you do it from machine code?

    I've used IN A,(239) or something similar in the past...
    daveysludge daveysludge March 2012 Sinclair Basic
  • Reading interface 2 using the IN commandHow do you read using the IN command from BASIC? You can read multiple keys at once, but I cant remember the values...

    ... have to deal with DEF FN, but you will have to ...
    mcleod_ideafix mcleod_ideafix March 2012 Sinclair Basic
  • Reading interface 2 using the IN commandHow do you read using the IN command from BASIC? You can read multiple keys at once, but I cant remember the values...

    ... BASIC lines where I use FN b() to do the same ... . The second parameter in the FN statement is the value to ...
    mcleod_ideafix mcleod_ideafix March 2012 Sinclair Basic
  • Copying a SCREEN$ in ZX BASIC in 1 second?!Following on from the revived "[thread=20207]Saving a complete SCREEN$ in BASIC[/thread]" thread (although Arjun really only needed a suitable POKE i…

    ... 63785. I then simply set DEFADD to point to this memory ...
    Paddy Coleman Paddy Coleman March 2012 Sinclair Basic
  • LZ77 en/decodingI've written an LZ77 en/decoding routine as I couldn't find one around for the Spectrum. Initially I'm just doing it in BASIC to get the logic right.…

    ... =VAL "64000": LET l=FN p(p):
    PRINT ... PAUSE NOT PI: LET t1=FN t(): RANDOMIZE USR m(2 ... 't2-t1:
    DEF FN p(a)=VAL "PEEK a ... x-y))/2:
    DEF FN u()=VAL "65536*PEEK 23674 ... "/50:
    DEF FN t()=FN m(FN u(),FN u())
    [/code ...
    Battle Bunny Battle Bunny March 2012 Development
  • Increasing the number of UDGs...Hi Folks, I know by default the Spectrum can have 21 UDGs (48K) and 19 (128K) and that the address of the bit patterns is pointed to by the UDG syst…

    ... />
    [code]
    2 DEF FN p(a)=PEEK a+256 ... /> DEF FN g(v)=v-FN h(v)*256: DEF FN h(v ... br /> POKE 23675,FN g(UDG): POKE 23676,FN h(UDG):
    LET CHANS=FN p(23631): REM Start of ... UDG256=UDG-100: POKE Sout,FN g(UDG256): POKE Sout+1 ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... /> [code]
    100 DEF FN b$(n,b$)
    =("0 ... LEN b$)
    +VAL$ (("FN b$("+STR$ INT (n/2 ... as just 1E+9 but FN b$(999999999,"") prints the ... /> [code]
    (if n0) : FN b$(INT (n/2),STR ... need is a recursive DEF FN visualisation utility, which can ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... need is a recursive DEF FN visualisation utility, which can take ... would be evaluated by the FN call as in the second ... to fix a broken DEF FN.[/QUOTE]
    Wouldn't it ... generate an eye-bleeding DEF FN from it.
    JamesW JamesW March 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... loop, then stick the DEF FN in the middle, replace the ... "DEF FN...=" with PRINT, remove any VAL ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
<1…14151617181920…30>

Latest Posts

  • Happy 40th Birthday to the Amstrad CPC464!
    AndyC on 6:29PM
  • Goodbye Z80
    i love the z80s on 6:28PM
  • Another Birthday! The Game Boy Is 35!
    dm_boozefreek on 6:17PM
  • I bought an accoustic guitar. How do you play it?
    Maroc's Other Projection on 6:04PM
  • I am currently watching.....
    Antiriad2097 on 5:05PM
  • European Software Titles with an English version
    harriusherbartio on 12:06PM
  • How Do You Categorize Your Speccy Software and Games?
    harriusherbartio on 11:21AM
  • Fixed Speccy Software. And which games remained unfixed?
    harriusherbartio on 11:01AM
  • New video about S-video modification on Issue two 48K Spectrum.
    Renegade on April 21
  • Elusive Strategy Games done by the Smaller or less Prolific Software Houses.
    harriusherbartio on April 21

HitBox

Word Docs Hits
fn 866 4.4K
defadd 102 200

Related Threads

  • DEF FN DirectivesI am looking at using some machine code functions from the DK Graphics Pack. They are machine code but they are called via Basic with the function de…
  • problem with DEFADD storageI have a function: DEF FN t(t$,m,t)=USR t<br /> which is called with, for an example: LET bc=FN t("t$()",mcworkspace,mcputt)<br /> where, at the time…
  • Can you improve this recursive DEF FN?I came up with this function to scan strings for characters without needing to use FOR...NEXT and IF...THEN, but it seems rather long-winded. Can any…
  • fn bug in basin?Hi.<br /> I was just trying to make myself some functions in basin and when i tryed them, the progam stopped on call.<br /> So i've tryed this simple…
  • FN nesting error?While playing with FN functions that call assembly, I've found something weird. <br /> <br /> Check out this code:<br /> [code]10 DEF FN f(a,b)=a+b<b…
  • BASin v.15 DEF FN bugThe bug would appear to be in "BASSupport.pas : Procedure ProcessDEFFN"; as it's not inserting the 6-byte variable place holder after each parameter …
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere.<br /> [code]<br /> 2 DEF FN t$(n,t,d)<br /> …
  • Fix for the DEF FN bug of zmakebasSome months ago I discovered a bug in zmakebas: it does not include the 5 bytes required after every parameter of a DEF FN.<br /> <br /> By the tim…
  • BASIC Bug: DEF FN after REMHello all,<br /> Having mused the Spectrum ROM disassembly by Drs Logan ad O'Hara, I wondered about how good ZX BASIC was at locating the DEF FN whe…

Related Searches

  • modulo function def fn
  • fuse def fn keyboard
  • def fn usr
  • def fn
  • def fn within a function
  • fn h
  • upper case fn
  • def fn d
  • recursive fn
  • bin def fn
  • def fn recursive bug
  • def fn bug
  • defadd
  • def fn recursive bin
  • fn usr
  • def fn library
  • def fn v
  • def fn gosub fast
  • def fn battlebunny
  • def fn fast

Copyright © 2024 World of Spectrum