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.006s
<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
  • 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…

    ... br /> [code]
    DEF FN B(b$)=VAL(CHR$ 196 ... ])
    [code]
    DEF FN C$(n)=CHR$ INT (n ... DEF FN F()=65536-USR 7962
    [/code]

    [b]HEX ... $[/b]([i]posint16[/i])
    [code]
    DEF FN H$( ... ])
    [code]
    DEF FN L$(l$)=CHR$ (CODE l ...
    chev chev November 2004 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…

    ... also a method using DEF FN (see [post=561279]this ... they both work, the DEF FN wasn't totally satisfying, ... the DEF FN definition is shown below. (I didn't include hex as ...
    [code]
    1 DEF FN b$(n,a,b,l ... br /> 2 DEF FN l(v)=v-FN h(v)*256: DEF FN h(v ...
    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 ... 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
  • 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 BASIC ... and used independently of any DEF FN statement, which allows quick RAM ... in the program as a hex dump DATA string, so that ... be done as a recursive DEF FN.

    Finally, knowing ...
    Battle Bunny Battle Bunny October 2012 Sinclair Basic
  • TXT2EMU enhancementI was looking at the encodings supported by BAS2TAP for entering graphics, print controls, etc. as plain text. Basically, there's only one needed, be…

    ... being {XX}, which allows any hex byte to be defined. All ... ):
    {00}-{FF} for hex byte values $00-$FF
    [code]DEF FN j$(s,l)=CHR$ PEEK ... (s)+VAL$ (("FN j$("+STR$ (s+1)+","+STR ... {A8} thus:
    [code]DEF FN j$(s,l)=CHR$ PEEK ...
    Battle Bunny Battle Bunny May 2013 Sinclair Basic
  • MOVE_M Object Movement Manager for BASICAs moving things around on the screen is usually the slowest part of a game written in BASIC, I've been pottering around with this routine to handle …

    ... defining the data tables as hex codes is rather tedious ... /> 10 REM Title
    11 DEF FN p(a)=PEEK a+256 ... *PEEK (a+1): DEF FN i(d,a)=USR MOVEI ... 12 CLEAR 62999: LET ORG=FN p(23730)+1: LOAD "MOVE_M ... /> LET DOTRAP=FN p(ORG): LET NOINT=FN p(ORG+2 ...
    Battle Bunny Battle Bunny September 2013 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…

    ... of commands in the range DEF FN (206) to COPY (255) which ... additional indent (currently set for: DEF FN, LPRINT, DATA, REM, FOR, INPUT ... -screen formatting.
    [*]Uses TXT2Emu {..} hex encodings for graphic & non ...
    Battle Bunny Battle Bunny March 2014 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…

    [code]
    DEF FN B$(n)=STR$ INT (n/128)+STR$ INT (FN V ... )+STR$ INT FN V(FN V(FN V(FN V(FN V(FN V(FN V(n ... /> Similarly:

    [code]
    DEF FN T$(n)=STR$ INT (n ... />
    I'll leave the HEX$ function optimisation as an exercise ...
    monty.mole monty.mole November 2004 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…

    ... /> [/quote]
    Well, changing the HEX$ function to make use of ... function to evaluate a single HEX digit, then have your function ... "optimised" version):

    [code]DEF FN D$(n)=CHR$ (INT n ... ]DEF FN H$(n)=FN D$(n/4096)+FN D$(FN V(n,4096)/256)+FN ...
    monty.mole monty.mole November 2004 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…

    ... ")[/code]:

    [code]DEF FN D(H$)=(CODE H$(1 ... also be made to the HEX$ function, although perhaps not ... calculation:

    [code]DEF FN H$(n)=CHR$ (INT (n ... ;9)+48)+CHR$ ((FN V(FN V(FN V(n,4096),256 ... ),16))+7*(INT FN V(FN V(FN ...
    monty.mole monty.mole November 2004 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…

    ... any functions (specifically CHR$, TO, FN) that appear in red are ... ". They'll turn into small hex-chars. When you've got ... completeness, here's Mike's DEF FN from hell in BASin-friendly ... :

    [code]
    10 DEF FN a$(n$)=VAL$ ((VAL$ (""""""+("+\#19434 ...
    Dunny Dunny May 2006 Sinclair Basic
  • Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …

    ... 255. (00 and FF in HEX).
    Any ideas?[/QUOTE]
    hex string. I'll let the ... why:

    [code]
    DEF FN x$(a) = CHR$(a+48 ... >9))
    DEF FN h$(x) = VAL$("FN h$(INT(x/16 ... ))+FN x$(x-16*INT ...
    Alcoholics Anonymous Alcoholics Anonymous February 2007 Sinclair Basic
  • Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …

    ... Anonymous;171624][code]
    DEF FN x$(a) = CHR$(a+48 ... >9))
    DEF FN h$(x) = FN x$(INT (x/16 ...
    Just do a PRINT FN h$(100).

    ... thread including a dec->hex converter similar to this ... Basic forum search for "hex", which only pulled up ...
    48K 48K February 2007 Sinclair Basic
  • reading Hex[code]1 DIM a$(20,20) 2 DIM g$(16) 3 LET g$="\::\ \' \ '\ .\. \.:\:.\:'\':\''\..\: \ :\'.\.'" 4 BORDER 4 20 LET a$(1)="00000000000000000000" 21 LET …

    ... you get basic to read hex as a number value< ... />
    Replace VAL(...) with FN n(...)

    you can ... />
    [code]
    10 DEF FN n(c$)=CODE c$-48 ... /> 40 PRINT t$(i),FN n(t$(i))
    ... simple version only supports uppercase hex digits i.e.
    ...
    Digital Prawn Digital Prawn December 2008 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…

    ... /> [I]hex4$[/I] = 4 digit hex string ("0000"-"FFFF")
    [I ... ,string[/I])
    [code]
    DEF FN M(x$,y$)=(x$ AND ...
    Dr BEEP Dr BEEP July 2009 Sinclair Basic
  • 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…

    ... of the "hex" method):

    [code]10 DEF FN b$(n)=("0000 ...
    30 PRINT FN b$(INT (n/16));FN b$(n-16 ...
    mcleod_ideafix mcleod_ideafix October 2010 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…

    ... definition?

    [CODE]
    DEF FN b$(b,u)=("" AND USR ... the string "0000000000000000" inside the DEF FN, so if you change it ... hex digit conversion
    7 DEF FN h(h$)=16*FN n(h$(1))+FN ... its starting address using the DEF FN x(a$).

    ...
    mattsteel mattsteel September 2011 Sinclair Basic
  • INSTR function...Hi Folks, Another little program that people might find useful: [CODE]100 DIM i(4) 110 LET a$="This is some sample text" 120 LET b$="text" 130 GO S…

    ... position p, defined as a DEF FN plus a *small* (117 bytes ... .

    [CODE]
    1 DEF FN i(n,t$,s$)=USR ... $,s$)=USR 23296
    2 DEF FN n(n$)=CODE n$-CODE ... hex digit conversion
    3 DEF FN h(h$)=16*FN n(h$(1))+FN ...
    mattsteel mattsteel 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 …

    ... by discarding the original hex code as part of ... initialisation routine and the hex code. It can then ... 1 DEF FN g(v)=VAL "v-FN h(v)*256": DEF FN h( ... v)=VAL "INT (v/256)":
    DEF FN ... PEEK (a+1)":
    DEF FN n(n)=n-CODE " ...
    Battle Bunny Battle Bunny September 2011 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 …

    ... idea i.e. use a HEX value to indicate the constant ... saved 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
  • 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…

    ... code sets up a dummy DEF FN of a$:

    [CODE ... :

    [CODE][B]Value Hex Character Description[/B]
    65 ... 29 ) Closing parenthesis for the DEF FN[/CODE]
    Next we need ...
    Paddy Coleman Paddy Coleman March 2012 Sinclair Basic
  • calculator and sinusok, look at the Sysel's routine: [PHP]3 5b00 *s 4 5b00 tabsin = #7000 03 mksin 19.11.1995 Busy soft …

    ... be included, that being allowing hex input in RUN 2000 (the ... the five byte values as hex numbers the relevant expression has ... to include
    hex conversion [JimG]
    10 DEF FN h$(n)=CHR ... *16:
    LET n$=FN h$(hi)+FN h$(lo): RETURN
    Battle Bunny Battle Bunny January 2013 Development
<1234567…34>

Latest Posts

  • i am currently listening to........
    Paradigm Shifter on 12:26AM
  • Happy 40th Birthday to the Amstrad CPC464!
    dmsmith on April 16
  • Celebrity deaths...
    mel the bell on April 16
  • Cooperative Games.
    Paradigm Shifter on April 16
  • LONELY TZX files : software TZX'd on the online sites with NO ASSOCIATED DOCUMENTATION
    harriusherbartio on April 16
  • European Software Titles with an English version
    harriusherbartio on April 16
  • How we became brainwashed by social media
    Antiriad2097 on April 16
  • How Do You Categorize Your Speccy Software and Games?
    Antiriad2097 on April 16
  • Fixed Speccy Software. And which games remained unfixed?
    harriusherbartio on April 16
  • I am currently watching.....
    zx1 on April 15

HitBox

Word Docs Hits
hex 1.7K 2.4K
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…
  • 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…
  • Why Hex in place of Denary?Ok - most MC books / tutorials advocate the use of hex instead of denary.<br /> <br /> But the Speccy doesn't actually have a Hex converter so you ne…
  • A very Slovakian adventure........Forever Hex DemopartyHey guys........I will be traveling from London Luton to Bratislava, and then onto Trencin for Forever Hex (the 8-bit Demo party - March 18-20)......…

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 trick

Copyright © 2024 World of Spectrum