Where can I find a searchable list of BASIC syntax? - basic

I am looking for a reference I can use to look up syntax for BASIC. The code is used on an old HP-85, which may affect the command list. I've had issues using Google because every time I search for something like "<> basic command" it thinks I literally mean basic and returns a bunch of introductory tutorials for other languages. I'll also accept an explanation for <> as an answer, below is the line which uses this.
IF X <> 700 THEN 5462. How does this decide whether or not to go to line 5462?

http://www.series80.org/Manuals/ is where your manuals are. I searched HP-85 and basic. For an overview of your computer see https://en.wikipedia.org/wiki/HP_series_80.

<> means "not equal to" in BASIC and is analogous to the != operator in most other languages. To answer your example, this would only go to line 5462 if the variable X was anything other than 700 (ie it would always goto 5462 unless X was equal to 700).

Related

Is there a way of doing a Fuzzy Search that regards to key codes?

Basically I want to implement a fuzzy search that disregards language!
For example - let's say that there's an entry for "Hello World".
Now, I want this to work with:
"hello"
"henlp"
"руддщ" (these are the Russian characters if you try to type "hello" but forget to switch to English)
"рутдз" (same as above but with "henlp" instead of "hello")
"יקמךם" (same as above but in Hebrew)
etc.
Now the things that makes most sense to me is to ignore the actual text and regard their relevant keyCodes, which all obviously work universally).
I did thought about for each entry, saving an array which represents all key codes - and then implement fuzziness based on the already given keyCodes instead of chars, but that feels like I'm doing something wrong, or missing something that already exists.
So, from what I've gathered there's no implementation of fuzzy search that regards this.
Is there maybe an alogrithm (other than fuzzy search) that already regards this which I'm missing?
Currently trying to implement in Node.js but open for more languages and frameworks

Misspelled, wierd split words search in XSLT & Umbraco

Is it possible in XSLT to search and find content, even though the content is misspelled or the words splitted up - even though it shouldn’t?
Example:
I need to find a webshop called bearshop.com, but I search it like this “bear shop”. This will end in a “no results”.
Another example:
I search “progresive” but the right word was “progressive”, and this will end in a “no result” as well.
The most important part is the first example, where the search can be written with or without white spaces and still find the content. Hope someone can help me or lead me in the right direction :)
Kind regards,
Niels
If you are looking for a general way of matching similar words, this is often called fuzzy search and can quite easily be done with Umbraco and Examine.
There may even is a way to use this with XSLT, though I never tested that.
Assuming XSLT/XPath 2.0 you can use //foo[matches(., 'bear\s*shop')].

'modifying' an exe by working with bas using visbasic or q basic

all!
I'm trying to run programs to control stepper motors. The PC and software and stepper motor controller I have already in place are pretty old and I'm new to almost everything I'm doing here-learning as I go sort of thing. I've 'coded' a bit in Matlab, so I have a very basic level of coding logic, but basically no knowledge of any common syntax. So, I know some about the steppers and the stepper controller, but not much else!
I have a program called "Hoop.exe" that I'm trying to modify to slow down the speed of one of the steppers (I just need to change a 300 to a 200!) when I run the program. There is also an associated (assuming) hoop.bas and a hoop.txt file on the floppy disc. From looking at the txt file, it looks like basic code from examples of basic I've seen. I'm working with visual basic 2.0 and qbasic 1.1 on Windows 98.
So, I tried opening the hoop.bas file first with qbasic and with vb. With qb, I get a 'bad file mode' message. With vb, I get 'invalid file format' and it seems it wants me to open a mak file but I have no 'hoop.mak'. I did this thinking that I could open the bas file with vb or qb, and then edit it, and then save it as an exe, and then run that.
I found a pdf that showed how to incorporate a qb file into the command button of vb, and I tried that. But, I got an "Expected: end of statement" error in the first line! when I tried to save it as an exe.
So, all I really want to do is change my hoop.exe. I would assume that since qb and vb are both on the PC, one of them wrote the bas (maybe not!), so I'm wondering why neither of them can read it.
I've never used vb or qb, but if I have to get into the nitty gritty, it seems like I'd rather use qbasic, since I've never used a graphical interface to code before. But, is either one of those necessary in order to do what I want to do? (I'm going to need to write some programs to control these steppers when all is said and done, but I figured that I should take it one step at a time.)
I tried some form of copying and pasting into qb, but I couldn't immediately figure out how to do that. (Probably because I have no idea how to use qb.)
So, what would be the most efficient way to modify my hoop program?
If the answer is that I just need to learn basic with qb, that's fine, but I'd like to get some sort of indication from people who know what they're talking about before I put that much effort in.
I would really appreciate any pointers because I'm apparently completely clueless on my own!
8/10/2013:
Just in case it's helpful, here are some lines from the Hoop.txt I opened:
10 CLS : CLEAR 1000: P = 512
20 LOCATE , , 1
100 A% = INKEY$: PRINT A$;
105 IF A$ = "*" THEN GOTO 700
110 GOSUB 510: GOSUB 610: GOTO 100
500 REM
510 IF A$ = "" THEN RETURN
etc. This is the beginning of the interface code that allows me to talk to the motor controller
QuickBASIC and Visual Basic are very different, despite their common name of "BASIC" and despite the fact they were both made by Microsoft. First you need to determine if the .BAS file is QuickBASIC or Visual Basic. A simple quick way (though not the most accurate) is to open the file up in Notepad or some other text editor. If keywords such as "OPEN" or "LEN" or "MID" or "CLOSE" are in uppercase, then its more likely a QuickBASIC file. If the keywords look more like "Open" or "Close" or "Len" or "Mid", then its more likely a Visual Basic file.
Now keep in mind that there are other versions of BASIC that have been developed, such as Turbo BASIC (Borland's version) or GW-BASIC or BasicA or PowerBASIC and even Color Basic.
Now if you can't figure it out this way, the next thing I'd suggest is downloading a hex editor, such as XVI32 (though there are many other free ones out there). Look through the file (especially towards the end of the file) and there are usually signs that indicate what kind of compiler was used. You might see the words "Microsoft Basic Compiler" or "Borland Turbo Compiler". Usually towards the end of the file, there are string "stubs" put in by the compiler or linker that you can use to determine the compiler.
If all that fails and you are desperate and that "300" number is hard coded in the program and you need to change it, then there is another way to do this. First back up your original exe file. Then Use XVI32 or some other hex editor and search for the string "2c01" (300 is 012c hex and you need to reverse the 01 and 2c since Intel machines are little-endian). Once you find an instance of 2c01, change it to "c800" (200 is 00c8. Little Endian version would be c800). Save the file, then rerun it. This is a gruesome trial and error way to fix this. If it was changed from 300 to 200, then everything is good! If not, restore from your backup and try again!
Have you considered getting an Arduino or some other low cost and friendly electronics development platform? I think it would be the way to go for you to control stepper motors...
take a look:
http://arduino.cc/en/Tutorial/StepperUnipolar
If you google around you'll find tons of you tube videos showing off some arduino controlled stuff.
Modifying your current .exe seems to me a too long and hard path to follow instead of making your own and proper source code for achieving what you want, as you would need to disassemble the executable file and literally "know what you're doing" with all that assembly language to find where to patch the binary with the right value.
Anyway, if you post a picture or a schematic of your old hardware I could try to help you a little more, but I guess that would be better suited to this other stack exchange site:
http://electronics.stackexchange.com

Intelligent file search for windows that can ignore whitespace and search in code?

Does anybody know a Windows based searching tool that is easy to use and is programmer
friendly.
The functions I am looking for:
Ignore white space in search
= capable to find
myTestFunction ( $parameter, $another_parameter, $yet_another_parameter )
{ doThis();
using the query
myTestFunction($parameter,$another_parameter,$yet_another_parameter){doThis();
without Regexes.
Search code "semantically" (for me, it would have to be PHP):
Search in comments only
Search in function names only
Search for parameters that are named $xyz
Search in (insert code construct here) only
If there is none around, it's high time somebody developed it! :)
I have opened a bounty for this.
See our SD Search Engine. This is a language-sensitive search engine designed to search large code bases, with special language classifiers for C, C++, Java, C#, COBOL, JavaScript, Ada, Python, Ruby and lot of other languages, including your specific target langauge PHP (PHP4 and PHP5).
I think it does everything you requested.
It indexes the language elements so search across large code bases are extremely fast (Linux Kernal ~~ 7.5 Million lines --> 2.5 seconds). (The indexing step runs
on Windows, but the display engine is in Java.)
Search hits are shown in one-line context hit window showing the file and line number, as well as the line with the hit highlighted. Clicks on hits bring up the source code, tabs expanded appropriately, and the line count right even for languages which have odd line counting rules (such as GCC WRT form characters), with the hit line and hit text highlighted. Clicking in the source window will launch your favorite editor on the file.
Because it understands language elements, it ignores language-specific whitespace. It skips over comments unless you insist they be inspected. Searches thus ignore whitespace, comments and lineboundaries (if the language thinks lineboundaries are whitespace, which is why there are langauge-specific scanners). The query language allows you to specify which language tokens you want (specific tokens in quotes, or generic tokens such as identifiers I, numbers N, strings S, operators O and punctuation P) with constraints on the token value as well as a series of tokens.
Your example search:
myTestFunction($parameter,$another_parameter,$yet_another_parameter){doThis();
would be expressed to the search engine precisely as:
I=myTestFunction '(' I ',' I ',' I ')' '{' I=dothis '(' ')' ';'
but it would probably be easier (less typing) to find it as:
I=myTest* ... I=dothis
where I=myTest* means an identifier starting with myTest and ... means "near".
The Search Engine also offer regular expressions searches on the text, if you insist.
So you still have grep-like searches (a lot slower than indexed searches)
but with the hit window and source display windows too.
I use ack really successfully for this kind of thing, particularly when trying to find things in large codebases. I run it linux myself but I don't see any reason why it won't run on windows or in Cygwin at the very least. Check it out, I think you'll find it is exactly what you're looking for.
Search code "semantically" (for me, it would have to be PHP):
For this you could (and I think should) use some custom code using token_get_all()
See also the available tokens
Ignore white space in search
A simple regex should be sufficient. It depends on your regex-library, but most come with a whitespace modifier/flag.
For my Windows desktop search, I use Agent Ransack. I use this as a replacement for the windows search.
You can use regular expressions, but there is a nice entry screen if you want to avoid entering them directly.
Take a look at Google Desktop API, it has very powerful set of methods to do what you're looking for.
Of course it requires you to have the Google Desktop installed.
After reviewing it a little, it provides some functionality but not that specific as what you require.
I really like Crimson Editor and it allows RegEx searches. It has helped me a bunch over the past six years. I think it will fit your needs. Try it.
I use TextPad for searching code files in Windows. It has a very handy find-in-files function (Search / Find In Files) and you can use regex which should meet any search requirements. In the search results it will list the file location, line number and a snippet from that line.

Semantic difference between "Find" and "Search"?

When building an application, is there any meaningful difference between the idea of "Find" vs "Search" ? Do you think of them more or less as synonymous?
I'm asking in terms of labeling for application UI as well as API design.
Finding is the completion of searching.
If you might not succeed in finding something, call the feature "Search". For example text search in an editor can fail due to no matches - then calling it "Find" would be lying.
On the other hand: in an established job searching site, you can say "Find a PHP job" because you know that for (almost) anything your users want, there will be offerings. This also makes it sound confident, positive and energetic.
According to Steve Krug in Don't Make Me Think, when talking about usability for a publicly-facing web site, use the word Search for a search box and nothing else. (He specifically prohibits "Find", "Quick Find", "Quick Search", and all variations.)
The rationale is that "Search" is the most commonly understood term, so it's what people will look for when they aren't thinking, and you don't want your users to have to think (at all).
I would say that "find" is focused on getting a single, exact match. As in the example above, you "find" the perfect PHP job.
OTOH, you "search" for jobs that meet your criteria. Searching is what you do when you want to graze through several results. "Search" returns pages of results. "Find" is closer to "I'm feeling lucky."
Of course, the terms get used interchangeably sometimes. But, I think that's the essence of the difference.
In many applications, find means "find on the current page/screen", while search means "search the entire database/Internet." Web browsers, online help, and other applications seem to make this distinction.
Within most applications...
Find typically refers to locating text within the document at hand and jumps to the next occurrence.
Search typically refers to locating multiple documents (or other objects) and returns a list.
I wrote the built-in Find command in Acrobat 1.0 and worked on the full text Search engine for Acrobat 2.0 and 3.0.
Most software at that point that handled large amounts of text had a way to locate an exact match to a single word or phrase and called it Find/Find Next. This is what we called it in Acrobat 1.0. We knew from the start that this wasn't enough to handle entire repositories of documents, so we needed a way to scan across a whole set. We couldn't use Find since that was already in the UI and had established behavior, so we settled on Search. The decision was based on little more than the relatively small set of common words that convey the action.
Even harder is to come up with a reasonable icon for it. Our initial take was to use something similar to the old Yellow Pages logo:
(source: yellowpagecity.com)
but the lawyers shot that down - it was too close. We couldn't use a magnifying glass as we had zoom functions tied to that. We went with binoculars.
I don't think that there is any difference.
But then again, I'm Portuguese. :P
Find = Discover exact
Example: We write "Please find attached" in an email. We don't write "Please search attached".
Search = Discover exact + Related match
Example: Google Search
"Seek and ye shall find"
"Search and you will find"
One angle that (surprisingly) no one has mentioned, is that in English when you say you search something, that something is the thing you're searching within, not the thing you're trying to find. So unless you add the word 'for' (as in, to search for something), the two words are fundamentally different.
It becomes obvious with an example:
Find the room.
Search the room.
Two very different tasks! The first defines the object of your search. The second defines the scope of your search.
That's not completely irrelevant when talking about UIs. If your app has a search feature where the user can specify both the source and the object of their search, you might choose to use the words this way. For example:
Search: Current document
Find: "positive and energetic"
Yes, as some others have pointed out, the word 'Find' does imply a successful search, but let's not start calling app designers liars for using it when success isn't guaranteed. It's become a pretty standard term for searching a document for a particular string.
I think search is more generic and more suitable for text search. Find sounds more like 'find a specific record or a group of records'
After searching You find something.
Search for an answer on stackoverflow that you may find it.
For me Find is the success of a Search, that is to Find is to identify the location of something that's known to exist.
Search should always be used when you have no control on what the user is looking for.
Find talks about a specific one.
Search does not talk about a specific one.
Did you find the picture I requested yet?
No? Please search on internet. I need to present it in an hour.
Another one is below
Please find the attachment in this email.
(or)
You'll find the attachment below.
(or)
Please find attached.
here, we use find because it is a specific document which is attached to email.
we don't use the search here, as there is nothing to search in a larger domain.
Search is the primary interface to the Web for many users. Search should be global (not scoped to a subsite) and available from every page; booleans should be made intimidating since users usually use them wrong
Read this: https://www.nngroup.com/articles/search-and-you-may-find/

Resources