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.015s
<1…9101112131415…34>
  • 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…

    LOL - thanks Crisis but I will stick with good old BASin. It delivers everything I need and I can live without recursive DEF FN. ;)

    Paddy
    Paddy Coleman Paddy Coleman October 2011 Sinclair Basic
  • AND,XOR,OR,BIT,RES,SET,CPL,NEG,RLC,RRC,SLA,SRL,RL, RR,SRA for BASICAs this was drifting away from the original INKEY$ thread I thought that I'd create a new one. So here's a routine to provide all of the above mentio…

    ... :[/QUOTE]

    Yes, using FN so that the USR function ... is only specified in the DEF FN. Your code is easy to ... nested function rather than just FN z(a,b,"^").

    DEF FN a(a$)=USR address+VAL ...
    Battle Bunny Battle Bunny October 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(…

    ... , if I change the DEF FN to: DEF FN f(a,b)=a, the ... 2. Apparently, the subexpression FN f(2,FN f(3,1)) is ...
    guesser guesser October 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(…

    ... , is stored in its corresponding DEF FN "hidden place".
    2. ... " in the storage assigned to DEF FN f().
    3. Then, ... searching for a matching DEF FN function when a FN expression is found ... hidden places in the DEF FN function. When the FN function has been ...
    mcleod_ideafix mcleod_ideafix October 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(…

    ... numbers show up in the DEF FN. (My example, check hidden ... be inserted into the DEF FN stmt in the spaces ... to point along the DEF FN while CH-ADD points ... along the FN stmt.
    It looks ... Indeed the description of the FN/CH_ADD bug is rather ...
    roko roko October 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(…

    ... string functions although I believe FN stores pointers to strings rather ... :

    [code]
    10 DEF FN a$(a$,b$)=a$+b ... $
    20 PRINT FN a$("aaa","AAA")
    30 ... ")
    40 PRINT FN a$(FN a$("aaa","AAA"),FN a$("bbb","BBB ...
    BloodBaz BloodBaz October 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(…

    I agree with McLeods explanation. An inner FN with a different name has a private parking place and does not need the hidden storage in the same DEF FN statement. Did known recursive functions escape from this by having the inner FN's as the first element?
    roko roko October 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(…

    ... DE ; discard pointer to 'DEF FN'.
    POP DE ; restore ... HL ; save address in DEF FN statement
    PUSH DE ... HL ; save address in DEF FN statement
    PUSH DE ...
    mcleod_ideafix mcleod_ideafix October 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(…

    ... PUSH HL ; save address in DEF FN statement
    PUSH DE ; ... ;restore parms from stack to DEF FN places

    ... POP DE ; discard pointer to 'DEF FN'.
    POP DE ; restore ...
    mcleod_ideafix mcleod_ideafix October 2011 Sinclair Basic
  • AND,XOR,OR,BIT,RES,SET,CPL,NEG,RLC,RRC,SLA,SRL,RL, RR,SRA for BASICAs this was drifting away from the original INKEY$ thread I thought that I'd create a new one. So here's a routine to provide all of the above mentio…

    Using DEF FN is neater but really slows ... yet)
    +7.1 MI FN version
    +7.3 BB ...
    Battle Bunny Battle Bunny October 2011 Sinclair Basic
  • AND,XOR,OR,BIT,RES,SET,CPL,NEG,RLC,RRC,SLA,SRL,RL, RR,SRA for BASICAs this was drifting away from the original INKEY$ thread I thought that I'd create a new one. So here's a routine to provide all of the above mentio…

    ... QUOTE=Battle Bunny;571301]Using DEF FN is neater but really slows ... issue, such as:

    DEF FN z(a,b,o$)=USR ... dir
    DEF FN y(a,b,o$)=USR ... written as:
    FN z(FN z(scr, FN y(msdk,0,"~"),"& ... little:
    FN z(FN z(PEEK dscr, FN y(PEEK dmsk ...
    mcleod_ideafix mcleod_ideafix October 2011 Sinclair Basic
  • AND,XOR,OR,BIT,RES,SET,CPL,NEG,RLC,RRC,SLA,SRL,RL, RR,SRA for BASICAs this was drifting away from the original INKEY$ thread I thought that I'd create a new one. So here's a routine to provide all of the above mentio…

    ... the same way as the DEF FN method did, as the operator ... of "". As I said, the FN method is neater.)

    FN method come out at 25 ...
    Battle Bunny Battle Bunny October 2011 Sinclair Basic
  • Mazes and Tremaux's AlgorithmI've done a version of Tremaux's maze solving algorithm which solves my current test maze with 400 junctions and 715 connections in a reasonably quic…

    ... 1224
    1218 LET st=FN s(y$(i))-k3*ir ... STEP k3:
    LET loc=FN p(a+bo)
    1220 ...
    Battle Bunny Battle Bunny November 2011 Development
  • BREAK from GOSUBHere's another one. Just in case you wanted to break out of multiple GOSUB levels with a single command, here's a routine to do it, tested on all mod…

    ... been loaded at address 'retsub'. FN c() is quite handy as ... SUB FN c()+5: PRINT FN c(): GO TO FN c():
    DEF FN c ... ()=PEEK 23621+256*PEEK 23622
    10 GO SUB FN ... c()+10: PRINT FN c(): RETURN
    20 ...
    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
  • 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 …

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

    [B][Edit] [/B ...
    Paddy Coleman Paddy Coleman January 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 …

    ... saved 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 …

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

    [quote]
    DEF FN j$(s,l)=CHR$ PEEK (s)+VAL$ (("FN j$("+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…

    ... the 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…

    ... the name. In addition, as DEF FN parameters can only have single ... to 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…

    ... then string functions such as FN s$(), STR$ and CHR$ can ... memory after use of the DEF FN memory move. If I use ...
    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 ????? :-?

    ... ,207,99,405:
    DEF FN a(a$)=FN b(a$,1+INT ... *(LEN 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…

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

    [CODE ... 29 ) Closing parenthesis for the DEF FN[/CODE]
    Next we need ...
    Paddy Coleman Paddy Coleman March 2012 Sinclair Basic
  • RND numberHow do I go about selecting from the numbers 4,9,14 and 19? (RND*4)*5-1 ????? :-?

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

    Paddy
    Paddy Coleman Paddy Coleman 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 (" ... br /> 70 LET right=NOT FN b(t,8): PRINT (" ... 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...

    ... 't have to deal with DEF FN, but you will have to ...
    mcleod_ideafix mcleod_ideafix 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.…

    ... PAUSE NOT PI: LET t1=FN t(): RANDOMIZE USR m( ... LET t2=FN t(): PRINT 't2-t1:
    DEF FN p(a ... (a+1)"
    20 DEF FN m(x,y)=(x+y ... (x-y))/2:
    DEF FN u()=VAL "65536*PEEK 23674 ... 23672"/50:
    DEF FN t()=FN m(FN u(),FN u())
    [/code ...
    Battle Bunny Battle Bunny March 2012 Development
<1…9101112131415…34>

Latest Posts

  • I am currently watching.....
    mel the bell on 5:54PM
  • Happy 40th Birthday to the Amstrad CPC464!
    Luny on 5:14PM
  • Your Favorite Magazine Cover Tapes.
    dm_boozefreek on 4:45PM
  • "Late Entries"
    harriusherbartio on 4:00PM
  • How Do You Categorize Your Speccy Software and Games?
    harriusherbartio on 1:34PM
  • Simple Sprite Routine
    dmsmith on 1:25AM
  • Today's BASIC program: visit attribute cells I am interested in, in pseudorandom order
    Paradigm Shifter on April 11
  • How do you share programs online?
    firelord on April 11
  • Celebrity deaths...
    Ælita on April 11
  • Who Has Got The Earliest ZX Spectrum Software?
    harriusherbartio on April 11

HitBox

Word Docs Hits
fuse 6.8K 11.8K
def 11.7K 12.9K
fn 866 4.4K
keyboard 14.1K 21.6K

Related Threads

  • ANNOUNCE: Fuse 0.6.1, libspectrum 0.2.0, fuse-utils 0.6.1I'm pleased to announce the release of the Free Unix Spectrum Emulator (Fuse) 0.6.1, which is now available from its [url="http://www.srcf.ucam.org/~…
  • Keyboard stickers for a DK'Tronics keyboardSee topic.<br /> I know sintech used to sell them, but I can't find them in their shop anymore.<br /> Anyone know another place where to get these pu…
  • 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…
  • Keyboard issue on Fuse for LinuxHi,<br /> <br /> My laptop has only one 'enter' key, though it seems it acts<br /> like it was the numeric pad enter key. So I can do nothing<br /> u…
  • 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 …
  • SAGA 1 Emporer keyboard ->swap-> dk' Tronics keyboardHi,<br /> <br /> Anyone here that would like to swap a SAGA 1 Emporer keyboard for a dk Tronics keyboard?<br /> Without the insides, just the keyboar…
  • 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 /> …

Related Searches

  • fuse onscreen keyboard
  • modulo function def fn
  • fuse 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

Copyright © 2024 World of Spectrum