Stuart Taylor Posted April 18, 2007 Share Posted April 18, 2007 I'm sure there is a very simple calculation to do this but for some reason i can't see it. best Stuart Let ( [ //a = number from 1 to 5 a = 1 ; //b = number from 1 to 5 b = 5 ] ; Choose ( a ; Choose ( b ; 00 ; 01 ; 02 ; 03 ; 04 ) Choose ( b ; -1 ; 00 ; 01 ; 02 ; 03 ) Choose ( b ; -2 ; -1 ; 00 ; 01 ; 02 ) Choose ( b ; -3 ; -2 ; -1 ; 00 ; 01 ) Choose ( b ; -4 ; -3 ; -2 ; -1 ; 00 ) ) ) ps the 00 are just to make it readable a simple number is all that needs to be returned. Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 are you sure that's right? -- your missing the zero values in the choose statement. i.e. Choose( 2 ; 0 ; 1; 2 ) will return 2 Choose( x ; result0 ; result1; result 2...) Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 got it... -a + b Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 your right genx, i always forgot the first choose is 0 Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 or just b-a lol Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 LOL Its one of those days Why must my brain do this to me sometimes. I remember sitting at school aged 10 and spelling "a", "ay" and thinking i'm sure thats not right but i can't for the life of me work out why. Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 Don't I know the feeling :) Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 Out of curiosity, are you seeing this topic as: Can't see the wood for the trees Link to comment Share on other sites More sharing options...
Inky Phil Posted April 18, 2007 Share Posted April 18, 2007 I am Ph&@039il Link to comment Share on other sites More sharing options...
Inky Phil Posted April 18, 2007 Share Posted April 18, 2007 I was Phil Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 I have changed it from Can't to Cant, to preserve this valuable topic for antiquity Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 Did you actually type an apostrophe in or copy it from somewhere else? Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 Can't Link to comment Share on other sites More sharing options...
Genx Posted April 18, 2007 Share Posted April 18, 2007 Well, i assume there is a difference between the topic and the body... Anywho, was just curious. Link to comment Share on other sites More sharing options...
Søren Dyhr Posted April 18, 2007 Share Posted April 18, 2007 I can't get into my head why you do jump all these Choose( hoops when the entire thing can be written this way: Right("0" & GetAsText(theB-theA);2) --sd Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 see what your saying but although its not clear in the example the range could potentially be highter than 9. don't think the solution could really be any simpler than b-a best Stuart Link to comment Share on other sites More sharing options...
Søren Dyhr Posted April 18, 2007 Share Posted April 18, 2007 9 what??? --sd Link to comment Share on other sites More sharing options...
Stuart Taylor Posted April 18, 2007 Author Share Posted April 18, 2007 Quote: ps the 00 are just to make it readable a simple number is all that needs to be returned. The original example (although functional) was illustrative. Link to comment Share on other sites More sharing options...
Søren Dyhr Posted April 18, 2007 Share Posted April 18, 2007 Hence the lack of quotes then!! --sd Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6190 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now