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 1000 results in 0.008s
<1234567…34>
  • 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…

    ... via Basic with the function defined such as DEF FN g(x, y ... bytes following the CALL nn function need to contain the parameters ...
    carlinski carlinski December 2007 Development
  • 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…

    I came up with this function to scan strings for ... br />
    Using:

    DEF FN w(w$,o$,c)=VAL ...
    with:

    w$(FN w(w$,o$,1))
    function on its own will return ... (eg. GO SUB 1000+FN w(w$,o$,1)*100).
    Battle Bunny Battle Bunny September 2010 Sinclair Basic
  • 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 …

    ... after each parameter in the DEF FN definition. There's code there ...
    Battle Bunny Battle Bunny April 2012 Emulators
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere. [code] 2 DEF FN t$(n,t,d) =STR$ INT (n/t)…

    ... nowhere.
    [code]
    2 DEF FN t$(n,t,d)
    +VAL$ (("FN t$("
    +STR$ (n-INT ...
    Battle Bunny Battle Bunny August 2013 Sinclair Basic
  • 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. By the time, the WoS f…

    ... after every parameter of a DEF FN.

    By the time ...
    programandala.net programandala.net August 2015 Sinclair Basic
  • BASIC Bug: DEF FN after REMHello all, 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 when call…

    ... BASIC was at locating the DEF FN when called upon.

    [code]
    10 DEF FN a()=10
    20 PRINT ... :
    [code]
    10 REM : DEF FN a()=10
    20 PRINT ... ROM routine that looks for DEF FN, DATA and (oddly) NEXT appears ...
    BloodBaz BloodBaz May 2022 BASIC
  • problem with DEFADD storageI have a function: DEF FN t(t$,m,t)=USR t which is called with, for an example: LET bc=FN t("t$()",mcworkspace,mcputt) where, at the time: mcworkspac…

    I have a function: DEF FN t(t$,m,t)=USR ... , for an example: LET bc=FN t("t$()",mcworkspace,mcputt)
    function to be simply: DEF FN t(t$,m ...
    Battle Bunny Battle Bunny July 2010 Sinclair Basic
  • that "listing variables during runtime" thingWell, I did eventually finish this, but with my meds playing up I don't have much time each day that I can spend at the computer, so it's taken rathe…

    ... don't want the listing function there are elements of the ... to be called from the function:
    DEF FN s$(r,k)=STR ...
    Battle Bunny Battle Bunny November 2013 Sinclair Basic
  • Akalabeth gamei found now that someone ported an ansi-basic game (coded in 1979?) to msx-basic - what about a zx-spectrum basic version of it? ;) https://plus.goo…

    ...
    Functions:
    [code]
    DEF FN d(w,x)=INT ((x ... Y pixel coord
    DEF FN p(a)=PEEK a+ ... a,a+1.
    DEF FN r(a)=8001
    ... emulate Apple-II RND function.
    DEF FN x(x)=INT (x ... X pixel coordinate
    DEF FN y(y)=175-y: HPLOT ...
    Battle Bunny Battle Bunny August 2016 Sinclair Basic
  • what does the USR command actually stand for?im sure its an acronym, if i remember rightly. ____ sub routine?

    ... it as a user-defined function DEF FN a(p,q) = USR [i ...
    John Elliott John Elliott June 2019 BASIC
  • FN nesting error?While playing with FN functions that call assembly, I've found something weird. Check out this code: [code]10 DEF FN f(a,b)=a+b 20 PRINT FN f(FN f(…

    ... this code:
    [code]10 DEF FN f(a,b)=a+b ... , if I change the DEF FN to: DEF FN f(a,b)=a, the ... nested calls to the same function, then there are combinations of ... same function in a nested call.

    [code]10 DEF FN f ... ,b)=a+b
    20 DEF FN g(a,b)=a+b ...
    mcleod_ideafix mcleod_ideafix October 2011 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…

    I want this function to PEEK 'l' bytes from ... it to work?

    DEF FN j$(s,l)=CHR$ PEEK ... (s)+VAL$ "FN j$(s+1,l-1 ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • number padding functionI wrote a number padding function in BASIC a while ago, but when I came to want it again I couldn't find it, so I've done this enhanced [url=http://w…

    ... a number padding function in BASIC a while ... padnum.asm]PadNum[/url] function in assembler. As ... /> [code]
    DEF FN p$(n,l,r)=STR ... := "1.0"
    FN p$(1,-5,3) := " ... 1.000"
    FN p$(1,-5,0) := " ...
    Battle Bunny Battle Bunny May 2012 Sinclair Basic
  • Function works in SpecBAS but not BASinSo, is there any reason why this user defined function works in SpecBAS but not BASin? [code] 10 DEF FN m$(a$,n1,n2)=a$(n1 TO n2) 20 LET a$="The…

    So, is there any reason why this user defined function works in SpecBAS but not BASin?

    [code]
    10 DEF FN m$(a$,n1,n2)=a$(n1 TO n2)
    20 LET a$="TheManInTheMoon"
    50 PRINT FN m$(a$,12,15)
    60 STOP
    [/code]
    Richey Richey May 2016 Sinclair Basic
  • New Functions for Sinclair BasicA total of 52 new functions can be added to Sinclair BASIC; 26 numeric functions (A-Z) and 26 string functions (A$-Z$). Owing to the internal structu…

    ... priority; for example, the MOD function should normally occur first. Where ... ]FREE[/b]()
    [code]
    DEF FN F()=65536-USR 7962
    [code]
    DEF FN H$(n)=CHR$ (INT (n ... ]string1[/i])
    [code]
    DEF FN L$(l$)=CHR$ (CODE l ...
    chev chev November 2004 Sinclair Basic
  • BASin Release 13 is now availableI'm still at it. BASin is now in it's 13th incarnation (disregarding the inter-version updates) and is now available at [url="http://homepage.ntlw…

    ... the 128k error reports now function correctly. (Lloyd Garland provided the ... links a bit.
    Fixed - DEF FN lines were getting their last ... compatibility meant that REM and DEF FN behaved incorrectly.
    Fixed - REM ...
    Dunny Dunny January 2006 Emulators
  • BASin Release 13 is now available[unashamedly x-posted from Emulators forum] I'm still at it. BASin is now in it's 13th incarnation (disregarding the inter-version updates) and is …

    ... the 128k error reports now function correctly. (Lloyd Garland provided the ... links a bit.
    Fixed - DEF FN lines were getting their last ... compatibility meant that REM and DEF FN behaved incorrectly.
    Fixed - REM ...
    Dunny Dunny January 2006 Sinclair Basic
  • Recursive functionsA while ago Phil demonstrated a nice example of recursiveness in a DEF FN function. Sadly it doesn't appear to be online anymore and I have difficult…

    A while ago Phil demonstrated a nice example of recursiveness in a DEF FN function. Sadly it doesn't appear to be online anymore and I have difficulties finding it out myself: does anyone have a good example? Thx.
    Paul van der Laan Paul van der Laan November 2006 Sinclair Basic
  • Terminal Velocity!Hi, Don't know if I should be posting this sort of thing here, but I read the FAQ and didn't spot any "Don't" rules. So here you have my example of …

    ... "Constant e: ";e
    210 DEF FN h(e,x)=((e^((2 ... ^((2*x))-1))
    220 DEF FN v(a,c,e,g ... *m*g)/(p*a*c)))*FN h(e,(t*(SQR ((g ... =60
    240 LET v=FN v(a,c,e,g ... write an e calculator, tanh function and also a terminal velocity ...
    gcallard gcallard May 2008 Sinclair Basic
  • Is this a bug in BASin?Hi Folks, I seem to be getting a lot of issues when trying to use functions with BASin. For example, the following: [CODE]100 DEF FN a(x,y,p$)=COD…

    ... following:

    [CODE]100 DEF FN a(x,y,p$)=CODE ... TO y)
    110 PRINT FN a(3,4,"Paddy")[/CODE ... , or vice versa). Situation: Any function.[/B]

    The same ...
    Paddy Coleman Paddy Coleman August 2010 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…

    ... br /> 10 DIM s$(6912): DEF FN p(a)=PEEK a+256 ... +1):
    DEF FN l(v)=v-256*FN h(v): DEF FN h(v ... )=INT (v/256):
    LET udg=FN ... 14,0,FN l(df),FN h(df),FN l(dl),FN h(dl ... not evaluating a user-defined function) to point to the dummy ...
    Battle Bunny Battle Bunny April 2011 Sinclair Basic
  • checking bits in BASICThe question of manipulating bit patterns in BASIC was raised recently in this [thread=35728]Keys redefine routine and key check[/thread] thread. I s…

    ... ]). Although they both work, the DEF FN wasn't totally satisfying, so ... a shortage of them) :); the DEF FN definition is shown below. (I ... />
    2 DEF FN l(v)=v-FN h(v)*256: DEF FN h(v ... function.
    [code]
    DEF FN n$(n,a,b,l)=FN b$(VAL FN ...
    Battle Bunny Battle Bunny September 2011 Sinclair Basic
  • fn bug in basin?Hi. I was just trying to make myself some functions in basin and when i tryed them, the progam stopped on call. So i've tryed this simple thing: 10 …

    ... simple thing:

    10 def fn a(x)=x*10
    20 print fn a(10)

    and ...
    rikokun rikokun September 2011 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…

    ... remembered Dr Beep's recursive DEF FN version, but in between ... thought I'd write a DEF FN to do it ... and ... br /> [code]
    100 DEF FN b$(n,s$)
    =s ... the end of the function would do it the ... order, but if the function expanded s$ from right ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • enhanced GOSUB/GOTO (in BASIC)Further to my previous post under "BREAK from GOSUB" here's the two ideas mentioned there put together. Note that to keep it quick it expects the DEF…

    ... it quick it expects the DEF FN r() to be at the ... DEF FN r(g,s,l)=g:
    DEF FN c()=FN p(23621): DEF FN p ... +1):
    DEF FN g(v)=v-FN h(v)*256: DEF FN h(v ... /> The demo shows that this function can be used to GOTO ...
    Battle Bunny Battle Bunny May 2012 Sinclair Basic
  • A "bit" of a curiosityHaving to use a bit of m/code to do the AND in that key check function, I was prompted to revisit the "AND,XOR,OR,...for BASIC" topic and came up wit…

    ... AND in that key check function, I was prompted to revisit ... and came up with this function to do bitwise AND,XOR ... on RETURN

    llll DEF FN b(a,b,c,d ... /256)
    ....
    GO SUB FN b(val1,val2,opcode,bits ...
    Battle Bunny Battle Bunny June 2012 Sinclair Basic
  • A Miscellany of Dangerous TipsHere's a selection of ideas for using some of the more obscure system variables which I've found handy on occasion. They can be very convenient if us…

    ... be automatically created within the DEF FN statement itself by the ... and used independently of any DEF FN statement, which allows quick ... last reference to a function remain available for reference ... its variable space after the function has been evaluated, so ...
    Battle Bunny Battle Bunny October 2012 Sinclair Basic
  • A 128 Routine to Put Tokens in StringsI was writing a DEF FN on the +128k and decided that I'd had enough of not being able to put function tokens in strings without a great palaver and s…

    I was writing a DEF FN on the +128k and ... not being able to put function tokens in strings without a ... the initial letter of the function as a UDG wherever it ... /> [code]
    9990 DATA "fn",168,"and",198,"len",177 ... AND b>=ae):
    DEF FN p(a)=PEEK a+256 ...
    Battle Bunny Battle Bunny December 2012 Sinclair Basic
<1234567…34>

Latest Posts

  • Your Favorite Magazine Cover Tapes.
    Your Spec-chum on 2:19PM
  • Where to Buy the New or Fairly Recent , Excellent ZX Spectrum Games Software?
    Your Spec-chum on 1:34PM
  • i am currently listening to........
    mel the bell on 11:34AM
  • Mis-labeled cassette titles or a name change?
    harriusherbartio on 11:06AM
  • Ways to preserve Speccy Tapes in the loft
    harriusherbartio on 10:58AM
  • Fixed Speccy Software. And which games remained unfixed?
    harriusherbartio on 10:47AM
  • Minor British Sports that did become games on the ZX Spectrum
    harriusherbartio on 10:30AM
  • How to return to basic properly from ASM
    Paradigm Shifter on 1:54AM
  • Frankie's ZX Spectrum Digouts
    Zup on April 8
  • Elusive Strategy Games done by the Smaller or less Prolific Software Houses.
    harriusherbartio on April 8

HitBox

Word Docs Hits
modulo 70 93
function 4.3K 6.5K
def 11.7K 12.9K
fn 866 4.4K

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…
  • 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…
  • SpecBAS INT function vs Spectrum INT functionDunny's SpecOS (SpecBas) vs Normal Spectrum Basic.<br /> <br /> INT function<br /> <br /> The Spectrum rounds -ve INT values down (e.g. INT -2.2 = -3…
  • 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…
  • New Forums at 'Def Guide to ZZAP!64' siteI know that there are some C64 fans and ex-readers of 'ZZAP!64' here, so just to let you know that Iain has added a new style message board to his si…
  • Access Database function in ZX-Rainbow S.E. yes or no?Dear friends and users of ZX-Rainbow!<br /> <br /> history:<br /> I have had some problems with ZX-Rainbow S.E. and a very bad time last weeks: The g…

Related Searches

  • fuse def fn keyboard
  • def fn usr
  • def fn
  • def fn within a function
  • def fn d
  • bin def fn
  • def fn recursive bug
  • def fn bug
  • def fn recursive bin
  • def fn library
  • def fn v
  • def fn gosub fast
  • def fn battlebunny
  • def fn fast
  • def fn look for
  • spaghetti def fn
  • dr beep s recursive def fn
  • dr beep def fn
  • def fn trick
  • bin function def fn

Copyright © 2024 World of Spectrum