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.114s
<1234567…34>
  • 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 characters ... see a way to shorten it?

    Using:

    DEF FN ... always ends with a "$"). Alternatively, just using the function on its own ... will return a pointer which ...
    Battle Bunny Battle Bunny September 2010 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 decided ... of the function as a UDG wherever it is to occur within a quoted ... string. So for FN insert UDG F ... >=ae):
    DEF FN p(a)=PEEK a+256*PEEK (a+1)
    [/code ...
    Battle Bunny Battle Bunny December 2012 Sinclair Basic
  • 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
  • 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…

    ... s$(6912): DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN l(v ... zero when not evaluating a user-defined function) to point to the ... dummy area, and so a$ becomes ...
    Battle Bunny Battle Bunny April 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 result is ... same function in a nested call.

    [code]10 DEF FN f(a,b)=a ... +b
    20 DEF FN g(a,b)=a+b
    30 PRINT FN f(FN ...
    mcleod_ideafix mcleod_ideafix October 2011 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 ... came up with this function to do bitwise AND, ...
    [code]
    REM a = val1 = 1st number
    b ... br />
    llll DEF FN b(a,b,c,d,g,v ... /> ....
    GO SUB FN b(val1,val2,opcode,bits ...
    Battle Bunny Battle Bunny June 2012 Sinclair Basic
  • Raising to the powerA curiosity of ZX Basic I found yesterday is that you can't do this: [code] 10 LET x=-3 20 LET y=x^2 [/code] While you can for example do LET y=-3^…

    A curiosity of ZX Basic ... you're raising to as a floating point number and ... real solution to a negative number raised to a non integer ... even power will always have a positive result. However this ... for example be included within a function defined by DEF FN)?
    Winston Winston April 2013 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…

    Some months ago I discovered a bug in zmakebas: it does ... required after every parameter of a DEF FN.

    By the time ...
    programandala.net programandala.net August 2015 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
  • 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 FN a()
    [/code]
    10 REM : DEF FN a()=10
    20 PRINT FN a()
    [/code]
    DEF FN, DATA and (oddly) ...
    BloodBaz BloodBaz May 2022 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…

    ... of arguments of user defined function if one is being evaluated ... the string "0000000000000000" inside the DEF FN, so if you change it ...
    7 DEF FN h(h$)=16*FN n(h$(1))+FN n(h ... within the string a$ and find its starting address using the DEF FN x(a ...
    mattsteel mattsteel September 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…

    ... within the string a$ and find its starting address using the DEF FN x(a ... for incorporating m/code into a BASIC program could be ... for a$ (plus 5 bytes for the FN x(a$) entry and a ... assembled directly into a$ by a small INKEY$ function combined with FN h() which ...
    Battle Bunny Battle Bunny September 2011 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 ... posint8[/i])
    [code]
    DEF FN A(x,y)=(128 AND INT ... br /> [code]
    DEF FN P(a)=PEEK a+256*PEEK (a+1)
    [/code ... FREE[/b]()
    [code]
    DEF FN F()=65536-USR 7962
    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 …

    ... : ";a;"m^2"
    200 PRINT "Constant e: ";e
    210 DEF FN ... *x))-1))
    220 DEF FN v(a,c,e,g,m,p ... /> Q: What is a PAQ?
    A: Like a FAQ, but "possibly" rather ... an e calculator, tanh function and also a terminal velocity calculator to ...
    gcallard gcallard May 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 …

    ... & loaded within each program file ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN ... g(v)=v-FN ... h(v)*256:
    DEF FN ... /> " POKE 23627,FN g(";newVARS;")"'
    ...
    Battle Bunny Battle Bunny August 2010 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 …

    ... the last line ="A"):
    DEF FN b(h$)=16*FN n(h$(1 ... ))+FN n(h$(2)):
    DEF FN ... -FN h(v)*fg: DEF FN h(v)=INT (v/fg):
    DEF FN p(a ... )=PEEK a+fg*PEEK (a ...
    Battle Bunny Battle Bunny September 2011 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…

    ... DATA line and thus saved within the program code;
    * note ... go anywhere, even in a DATA string within the program code).
    DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g(v)=v-256*FN ...
    Battle Bunny Battle Bunny February 2012 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
  • 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…

    ... ), but can be placed anywhere within reason.

    Take care ... (s$ is essentially treated as a DEF FN parameter) it can only be ... /> 2 DEF FN p(a)=PEEK a+256*PEEK (a+1): DEF FN g(v)=v-FN h ... (v)*256: DEF FN ...
    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 c()=FN p(23621): DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN g ... (v)=v-FN h ... /> The demo shows that this function can be used to GOTO ...
    Battle Bunny Battle Bunny May 2012 Sinclair Basic
  • Switching 48/128 modes within a BASIC programI'm not sure what use this would be; ie. being able to switch between 48k and 128k modes and back again from within a continuously running BASIC prog…

    ... and back again from within a continuously running BASIC program, ... 's been raised as a possibility I thought that ... I'd have a go.

    ... In that, by using a slightly modified version of the ... would have to use a slightly modified version of ...
    Battle Bunny Battle Bunny July 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…

    ... to a simple function call of the form: GO SUB FN q(a$,b ... it's doing with the function parameters, but so far it ... DEF FN p(a)=PEEK a+256*PEEK (a+1):
    DEF FN l(v)=v-256*FN ... around a screen segment
    [/code]

    --

    The function ...
    Battle Bunny Battle Bunny July 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 …

    ... this routine to handle that function in machine code, so the ... and vice versa. The function FN i(d,a) defines the currently active ... /> 11 DEF FN p(a)=PEEK a+256*PEEK (a+1): DEF FN i(d,a)=USR MOVEI ...
    Battle Bunny Battle Bunny September 2013 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…

    ... file "!Blocks" is used within my FORTH interpreter, but ... 512 bytes-length sectors available within my text-file. Subroutine ... write to the right position within the cartridge itself.
    ... DEF FN p(a)=256*PEEK (a+1)+PEEK a : REM DPEEK(a)
    2 DEF FN ...
    mattsteel mattsteel May 2018 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. …

    ... /> 10 DEF FN M(A,A$,Z,P$,Q$)=A+(A$=P$)*(A0): REM MOVE FUNCTION

    20 LET X=FN ... ","8")
    30 LET Y=FN M(Y,INKEY$,22,"6 ...
    Dr BEEP Dr BEEP April 2005 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. …

    ... ... anyone have a function to find the modulus of a division in BASIC ... />
    [code]10 DEF FN q(a)=(a/2)=INT (a/2)[/code]
    Or ... ]a[/B], and the base number in [B]b[/B]. The function ... should return [B]1[/B] when [B]a[/B] is ...
    Marcelo Marcelo December 2006 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…

    ... DEF FN w(a,s)=VAL ((a$(a,s) AND a$(a,s)>"#")+"+0"):
    the function ... by a "!".
    The results of a formula ... no alteration. However when a text is evaluated or ... g*7-3;((STR$ FN w(f,g)+b ... 3,1 ; FN W(1,1)*FN W(2,1 ... )
    in 4,1 : !This is a ...
    Dr BEEP Dr BEEP September 2007 Development
  • 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 a DEF FN.
    I defined the function something like:[CODE]DEF FN P(A,B,A ... called it with:[CODE]LET A=FN P(2,30,"Boobs")[/ ... get the parameters of the DEF FN function are to look at address ... variable which points to the DEF FN function in use.

    ...
    icabod icabod December 2007 Development
<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
within 7.8K 8.5K
a 589.5K 1.7M
function 4.3K 6.5K

Related Threads

  • A Spectrum, a couple of felt tip pens and a lot of free time on Sunday afternoons...In my opinion the best part of having a Spectrum was drawing a game map of the latest Ultimate game in the back page of my geography text book thereb…
  • I NEED A HAND FINDING A 3D CHESS GAME......WITH A HAND IN ITOk.Firstly - It's not one of the chess games in the archive with the word chess in the title.<br /> ##(Although - The ChessMaster2000 LOOKS very fami…
  • HELP!!! i need help turning a .wav files into a .tzx. im a new beginnerhi there. i hope anyone doesnt think im thick or owt but im having trouble in find the right program or the know how to convert all my 8bit mono .wav…
  • Free to a good home - Anyone in South Wales want a pile of Spectrum Games and a +3?Bit of an emergency - I'm moving out in a hurry and I don't have time to sell these!<br /> <br /> Is there anyone in South Wales who wants a fairly b…
  • A clever method of using a single 8-bit register to be used for two things at a timeI don't know if this is the way the SAVE routine in the Spectrum works. Anyway, this is what I've learned today.<br /> <br /> I've been commented the…
  • Sinclair QL: I'm searching for a Gold Card (or better a Super Gold Card) and a Super HermesIf someone here want to sell his Super Gold Card and Super Hemes I'm a big collector of QL stuff and I will pay very very well.<br /> <br /> Very tha…
  • Trying to find a magazine entry for a program I wrote as a child!Hi, <br /> <br /> Back when I was a child I wrote a program called "milkround" that we published in either your spectrum, your sinclair or sinclai…
  • im looking for a basic routine that adds a numerical character to a stringim looking for a basic routine that adds a numerical character to a string. so a=1, "1", then a=0 "10", then a=1 "101......" and so on
  • How to separate a character from a number in a string?Hi <br /> I've been writing a kind of logo type program in BASIC that takes a string a$ from INPUT and then draws according to what you give it. Say…
  • A TZX, a MIA and a previously unknown title from QLSThe Spanish website [url="http://trastero.speccy.org/"]El Trastero del Spectrum[/url] has a TZX of [url="http://www.worldofspectrum.org/infoseekid.cg…

Related Searches

  • modulo function def fn
  • fuse def fn keyboard
  • i demand a working search function
  • def fn usr
  • def fn
  • 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
  • bin function def fn

Copyright © 2024 World of Spectrum