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.017s
<1234567…34>
  • 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
  • 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
  • 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
  • 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…

    ... INT FN V(FN V(FN V(FN V(FN V(FN V(FN V(x,128),64),32),16),8),4),2)+INT FN V(FN V(FN V(FN V(FN V(FN
    chev chev November 2004 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 …

    ... e: ";e
    210 DEF FN h(e,x)=((e^((2 ... x))-1))
    220 DEF FN v(a,c,e,g,m ... m*g)/(p*a*c)))*FN h(e,(t*(SQR ... 60
    240 LET v=FN v(a,c,e,g,m ... "; BRIGHT 1;v: PRINT "kmh: "; BRIGHT 1;v*3.36: PRINT ... PRINT "mph: "; BRIGHT 1;v*2.237
    270 GO ...
    gcallard gcallard May 2008 Sinclair Basic
  • Compiling BasicI'm not good in compiling sinclair basic because i was 15 when i got my first spectrum, and it was the first computer i saw. I wasn't aware of compil…

    It might even be done with a recursive DEF FN. I need to think of the code however.

    Your program would be then

    instead LET A=VAL A$
    it will be LET A=FN V(A$)

    and a DEF FN V(A$)= .... in the begin of the prog.
    Dr BEEP Dr BEEP January 2003 Sinclair Basic
  • Compiling BasicI'm not good in compiling sinclair basic because i was 15 when i got my first spectrum, and it was the first computer i saw. I wasn't aware of compil…

    ... be done with a recursive DEF FN. I need to think of ... be LET A=FN V(A$)

    and a DEF FN V(A$)= .... in ...
    Dr BEEP Dr BEEP January 2003 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…

    ... :

    [CODE]
    1 DEF FN v(o$)=2*(o$="r")+3 ... c=(m>0)*(c$=" ")*FN v(k$):
    FOR r=1 ...
    Einar Saukas Einar Saukas 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…

    ...

    [code]
    1 DEF FN v(o$)=2*(o$="r")+3 ... c=(m>0)*(c$=" ")*FN v(k$):
    FOR r=1 ...
    Digital Prawn Digital Prawn August 2007 Development
  • Location of variableHi everyone When basic makes an array how to you find out the location in the ram of where the data is stored. :) Also, does it store the values in…

    ... REM DEF FN v()=PEEK (23627)+256*PEEK (23628)
    15 REM DEF FN t ... (a)/32)
    20 REM DEF FN c$(a)=CHR$ (PEEK (a ... br /> 9050 REM LET v0=FN v()
    9055 LET v0=PEEK ... /> 9130 REM LET n$(i0)=FN c$(v0)
    9135 LET ... NUMERIC
    9150 REM IF FN t(v0)5 THEN GO ...
    Paddy Coleman Paddy Coleman September 2010 Sinclair Basic
  • TAPlist - the emulator versionI've got this working reasonably well; there's just a couple of small extra features which I want to add. (Recall that TAPlist writes a formatted lis…

    ... PEEK (a+1):
    DEF FN v()=FN p(23627):
    POKE 23618 ... 7 AND (PEEK FN v()193 OR FN p(FN v()+4)1900)):
    FN v()+10) OR tabs> PEEK (FN v()+11))):
    RANDOMIZE marg=(tabs=USR (FN p(FN v()+6)-(63600-(FN v()+ ...
    Battle Bunny Battle Bunny April 2014 Sinclair Basic
  • Arrays in BASICHi so I'm making this crappy game and I wanna store the screen positions of some UDGs in in a 50x2 array cause I have 50 characters. So I made the ar…

    ... DEF FN p(a)=PEEK a+256*PEEK (a+1)
    2004 DEF FN v()=FN ... p(23641)-1-FN p(23627): REM =(E_LINE ... DEF FN e()=FN p(23627)+FN v()

    2030 LET VS=FN v(): LET VE=FN ...
    Battle Bunny Battle Bunny October 2016 Sinclair Basic
  • BASIC Keyword ReferenceRealised that the Sinclair Basic section would be a better place for discussion of BASIC keywords, so for reference the old thread is in [thread=2005…

    ... : E : O
    CLS : K : V PI : E : M
    CODE ... : D RANDOMIZE : K : T
    DEF FN : E : SYM + 1 READ : E ...
    icabod icabod March 2008 Sinclair Basic
  • storing machine code in BASICApart from putting m/c above RAMTOP, which means that it has to be POKEd or LOADed separately after the BASIC program; or putting it in a REM, which …

    ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v-FN ... h(v)*256:
    DEF FN h(v)=INT (v/256 ... br /> LET newVARS=FN p(23627)+machine_code_length+ ... :"'
    " POKE 23627,FN g(";newVARS;")"'
    " ...
    Battle Bunny Battle Bunny 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…

    ... ): DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN l(v)=v ... -256*FN h(v): DEF FN h(v)=INT (v/256):
    LET udg=FN p ... v: POKE a,v: NEXT a:
    DATA 65,36,14,0,FN ... l(df),FN ...
    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…

    ... and also a method using DEF FN (see [post=561279]this ... Although they both work, the DEF FN wasn't totally satisfying, so ... 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)=INT (v/256)

    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
  • 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( ... 9991 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
  • storing machine code in BASICA couple of years ago I posted a routine for storing machine code between PROG & VARS, based on an idea in Toni Baker's "Mastering Machine Code". Thi…

    ... been set up for a DEF FN statement, so the routine ... CHR$ FN g(n)+CHR$ FN h(n)+CHR$ 0+",":
    DEF FN p ... (a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v-FN ... h(v)*256: DEF FN h(v)=INT (v/256):
    < ...
    Battle Bunny Battle Bunny January 2012 Sinclair Basic
  • more on storing mazesPrompted by Wookiee's escapades, I've been pondering on how to use DATA statements directly for displaying background graphics, thus avoiding the dup…

    ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v ... -256*FN h(v): DEF FN h(v)=INT (v/256)
    11 ... LET udg=FN ... m: READ n$: LET datend=FN p(datadd):
    LET m ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • Screen2StringFurther to writing that BASIC one-liner to redirect CAT to a string I thought that I'd do a general redirection routine for anything which normally p…

    ... $ is essentially treated as a DEF FN parameter) it can only be ... DEF FN p(a)=PEEK a+256*PEEK (a+1): DEF FN g(v)=v-FN h(v ... )*256: DEF FN h(v)=INT (v/256)
    3 ... are redirected)
    DATA FN g(sa),FN h(sa):
    REM ...
    Battle Bunny Battle Bunny May 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…

    ... ): DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v-FN ... h(v)*256: DEF FN h(v)=INT (v/256)
    2 ... LET prog=FN p ...
    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…

    ...
    v = 0 = result on RETURN

    llll DEF FN b(a ... ,b,c,d,g,v)=g:
    ....
    GO SUB FN b(val1,val2,opcode,bits ... AND ba+bbc THEN LET v=v+2^p
    oooo NEXT ...
    Battle Bunny Battle Bunny June 2012 Sinclair Basic
  • saving time populating large arraysI use a variation on this idea for storing machine code at the end of programs without interfering with LIST, then it occurred to me that it would al…

    ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v-FN ... h(v)*256: DEF FN h(v)=INT (v/256)
    ... STOP
    12 LET vars=FN p(23627)-alen:
    POKE ... 23670,FN g(vars): POKE 23671,FN h(vars):
    Battle Bunny Battle Bunny October 2012 Sinclair Basic
  • quick RAM copy using LET in BASICI'm in the process of reviewing, revising and refining all the programming tips & utility routines which I've posted on this forum over the last eigh…

    ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN l(v)=v ... -256*FN h(v): DEF FN h(v)=INT (v/256)
    20 DEF FN ... q(a$,b$,l)=33: RESTORE 20: LET fnq=FN ... GO TO 40: REM find FN q() from DATADD
    42 REM FN q() PARAMETERS
    ...
    Battle Bunny Battle Bunny July 2013 Sinclair Basic
  • Full 16*16-digit BASIC multiplicationI liked Andre Adrian's 32-bit long multiplication routine so much that I decided to a decimal version. After all, 2^63 is only 9223372036854775808, a…

    ... [code]
    3 DEF FN R(r$)=RR: DEF FN p(a)=PEEK a ... $=FN b$(G)+FN b$(K)+FN b$(H)+FN b$(L)+
    FN b$(V)+FN ... b$(X)+FN ... b$(B)+FN ...
    Battle Bunny Battle Bunny July 2013 Sinclair Basic
<1234567…34>

Latest Posts

  • 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
  • 1992 Spectrum Software
    harriusherbartio on April 7

HitBox

Word Docs Hits
def 11.7K 12.9K
fn 866 4.4K
v 16.8K 25.3K

Related Threads

  • 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 …
  • speccy v's comodore v's bbcThose old enough to remember the playground days when we each had our own little group speccy better than the comodore and the bbc users were all gee…
  • 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…
  • 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…
  • Frying a 48K ZX Spectrum (revision 4A) with 10 V instead of 5 VHello<br /> <br /> I got a used zx spectrum. When I opened it up, there was no 5 V positive voltage regulator at the 10 V power inlet. Instead what…
  • 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…
  • Quiz V - the revenge of D`n`COk, 50 quick fire questions.. some cryptic - you`ll have un unravel the clues to get the game name, while others are description of the game. <br /> …

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

Copyright © 2024 World of Spectrum