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…

    ... the function defined such as DEF FN g(x, y, p, q ...
    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…

    ... ?

    Using:

    DEF FN w(w$,o$,c)=VAL ... (("FN w(w$,o$,c+1)" ... />
    with:

    w$(FN w(w$,o$,1))
    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
  • Display half a screenWorking in 128 Basic and saving screens to memory via - SAVE! "image" SCREEN$ . Is it possible to display just the top half (or the bottom half) of t…

    ... copied quickly by using the DEF FN trick which Paddy mentioned to assign ...
    Battle Bunny Battle Bunny October 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
  • saving part of a BASIC programHere's a short routine to save part of a BASIC program. The idea is that it can be merged into a program and then used to save sub-routines, etc. to …

    ... DEF FN b(h$)=16*FN n(h$(1))+FN n(h$(2)):
    DEF FN ... g(v)=v-FN ... h(v)*fg: DEF FN ... h(v)=INT (v/fg):
    DEF FN p ... LET prog=FN p(23635): LET vars=FN p(23627 ...
    Battle Bunny Battle Bunny September 2011 Sinclair 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 ... call.

    [code]10 DEF FN f(a,b)=a+b ...
    20 DEF FN g(a,b)=a+b ... !
    40 PRINT FN f(FN f(2,FN g(3,1)),4 ... !
    100 PRINT FN g(FN g(2,FN g(3,1)),4 ...
    mcleod_ideafix mcleod_ideafix October 2011 Sinclair Basic
  • Random Numbers, USR Return Values & Timing BASICI've been trying out Jon Ritman's random number routine, published in Your Sinclair Aug'87. Apart from a timing comparison I also did a frequency ana…

    ... point decimals, a slightly trickier trick allows string pointers to be ... /> 9999 LET t1=FN t(): LET t2=FN t(): LET t0=t1 ...
    Battle Bunny Battle Bunny January 2017 Sinclair Basic
  • Random-Access to Microdrive FileI am working on a BASIC program to backup a microdrive text-file to standard tape array-file. To backup a text-file from one microdrive to a secon…

    ... />
    The [b]first trick[/b] is the ability to ... bytes to room the trick using DEFADD as Battle ... />
    The [b]second trick[/b] is the ability to ... />
    The [b]third trick[/b] is the ability to ... /> 3 DEF FN l(v)=v-256*FN h(v): DEF FN h(v ...
    mattsteel mattsteel May 2018 Sinclair Basic
  • Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…

    ... variable crosswind.

    Added DEF FN r() to read the keyboard ... I had to use a trick that Dr. BEEP showed me ...
    Digital Prawn Digital Prawn August 2007 Development
  • Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…

    ... places, you could use a DEF FN to position the cursor like ... SOKO-BAN LINE. Maybe this trick could also help you here.
    Einar Saukas Einar Saukas September 2007 Development
  • Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…

    ... places, you could use a DEF FN to position the cursor like ... SOKO-BAN LINE. Maybe this trick could also help you here ...
    Digital Prawn Digital Prawn September 2007 Development
  • New oneliners for 2008[INDENT][INDENT][INDENT]Here's my attempt at a first-person-perspective 3d game in one line of BASIC. It's called 'wormhole', and you've got to get t…

    [code]
    1 DEF FN a(r,n)=r-INT ( ... ;"O"),3:
    LET c=FN a(3+PEEK 23673,256 ... $(p)=x$):
    PRINT "Room:";FN a(CODE c$(p),40 ... x$=h$;"NESW"(g);":";STR$ (FN a(CODE h$,40)^2 ...
    Dr BEEP Dr BEEP March 2008 Development
  • numbers to binaryHi everyone, I have looked through the manual and have found nothing. How do you change a number to binary easily? I know you can go binary to decim…

    ... a pity that Philip's trick for implementing recursion in Sinclair ... it... :)

    [code]10 DEF FN b$(n,d)=VAL$ "STR ... $(INT (n/d),d/2)+FN b$(n-d*INT (n ... -255): ";n
    30 PRINT FN b$(INT (n/16),4 ... );FN b$(n-16*INT (n/ ...
    mcleod_ideafix mcleod_ideafix October 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…

    ... command, so if I could trick the ROM into treating the ... area used by user-defined FN evaluations. I'd often used ... first I tried using a DEF FN to assign the display file ... I could use LET s$=FN s$(), but I got ... was using a user-defined FN by POKEing DEFADD with an ...
    Battle Bunny Battle Bunny April 2011 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...

    ... ]Reading 61438 should do the trick, how do you do it ... 't have to deal with DEF FN, but you will have to ...
    mcleod_ideafix mcleod_ideafix March 2012 Sinclair Basic
  • +3 DOS questionHey all, Is it possible to catalogue a +3 disk to a variable somehow from BASIC? I'm looking at extending my Snapshot to Microdrive utility, so it s…

    ... CAT loop (line 21). The trick is to assign any variables ... :

    [code]
    2 DEF FN p(a)=PEEK a+256 ... 23740,15:
    LET k1=FN p(23643): CAT : LET k2 ... =FN p(23643):
    POKE 23739, ...
    Battle Bunny Battle Bunny April 2012 Sinclair Basic
  • POKE taking a variable amount of time...Hi Folks, Does anyone know why the following POKE statements seem to vary in their execution time? [code]100 POKE 60000,10 110 POKE 60001,16…

    ... or am I missing (another!) trick?

    Many thanks

    [code]
    10 DEF FN a(b,c)=USR 60000 ...
    20 RANDOMIZE FN a (x,y)
    [/code ...
    GReW GReW September 2016 Sinclair Basic
  • BASin Release 10a is up...Well, none of my releases ever get far before the inevitable bug fix version... Go grab it at [url="http://homepage.ntlworld.com/paul.dunn4/BASin_…

    ... now ignored (BadBeard)
    Fixed DEF FN statements - not correctly tokenised (Chris ...
    Dunny Dunny June 2004 Emulators
  • Is there much ?Do you think there`s much cooperation, and in fact co-development now goes on within the 8-bit community.. in fact is there any? I know that`s a daf…

    ... a thing or two regarding Def FN and special pokes etc etc ...
    CKay CKay November 2004 Development
  • 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…

    ... [/i])
    [code]
    DEF FN B(b$)=VAL(CHR$ 196 ... [/i])
    [code]
    DEF FN C$(n)=CHR$ INT (n ... [/b]()
    [code]
    DEF FN F()=65536-USR 7962
    [code]
    DEF FN H$(n)=CHR$ (INT (n ... [/i])
    [code]
    DEF FN L$(l$)=CHR$ (CODE l ...
    chev chev November 2004 Sinclair Basic
  • BASin release 12b available for downloadOk, there were a few nasty bugs in the last release, so in fine SPIN team tradition here's a new release that possibly fixes those errors. In this r…

    ... /> Fixed Crisis's bug with DEF FN, and colin's problem with ...
    Dunny Dunny October 2005 Sinclair Basic
  • Lesser used BASIC commandsAre there any interesting articles or books that explore some of the lesser used BASIC commands/functions e.g. DEF FN, IN, OUT etc? The Spectrum BAS…

    Are there any interesting articles or books that explore some of the lesser used BASIC commands/functions e.g. DEF FN, IN, OUT etc?

    The Spectrum BASIC manual only glosses over them without going into a lot of detail.

    Necros.
    Ian Hamilton Ian Hamilton January 2006 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
def 11.7K 12.9K
fn 866 4.4K
trick 3.6K 3.9K

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…
  • 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…
  • A little trick in S.W.I.V.Do you know that there's a little hidden message in S.W.I.V.? I don't remember what you should do exactly but I think if you press the keys S and W o…

Related Searches

  • modulo function def fn
  • 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 copying

Copyright © 2024 World of Spectrum