Program to search inside programs - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Program to search inside programs (/thread-4832.html) |
Program to search inside programs - xset - 09-29-2015 05:44 PM Hello. As far as Programs sorted chronologically, first program text is text of current program. So u press SHIFT+[User] then S and enter text to search, it will print line number and text in the line. Unfortunately we can't control position of cursor inside program editor, and can't call editor to edit some program (i wish developers will think about it). U also can run Look code in text and same in attachment. Global search and local search - xset - 09-29-2015 06:52 PM U press SHIFT+[User] and G (Sin key) to call global search on program texts then enter text (currently case sensitive) and it will print results in form: Program name:Line Number: Text SHIFT+[User]+S (9 key) gives local search (search inside current program). Code:
Next task is case insensitive search and "Search and replace" in current program. RE: Program to search inside programs - xset - 09-29-2015 07:45 PM Case insensitive version (only English letters of course) Code:
RE: Program to search inside programs - cyrille de brébisson - 09-30-2015 05:40 AM Hello, Nice work! Cyrille RE: Program to search inside programs - xset - 09-30-2015 06:24 AM (09-30-2015 05:40 AM)cyrille de brébisson Wrote: Nice work! Thanks! I think this is only begining. We need fully functional editor. Currently i am investigating how to calculate exact size of text drawed TEXTOUT_P, so we could find there to put cursor and how much to shift because of scrolling. I think new editor should support: 1) Undo 2) Selecting of whole word by touching it (often used to copy variable name). 3) Fast shortcuts for selection of whole line or number of lines for copy-paste (current SHIFT-COPY SHIFT-PASTE is awful). 4) Some kind of autocompleting and hints 5) Fast gestures to call Search and Global Search with jumping on results. Also Search and Replace ! 6) Fast jumping between functions in current module (selecting from list). 7) Screen keyboard (because my eyes crying looking at orange letters on gray), useful with capacitive stylus. Any help would be appreciated. There many tasks for doing GUI things like listboxes, screen menus, dialogs for searching, etc. Best regards XSet RE: Program to search inside programs - StephenG1CMZ - 09-30-2015 07:55 AM I had thought my Z EDITOR was a useful way of searching Notes and Programs, until I saw your approach. Very impressive. Both our programs seem to have an issue parsing strings like "WAIT(", because INPUT returns a pair of brackets instead. Could you add searching of Notes too? RE: Program to search inside programs - hpfx - 09-30-2015 08:04 AM (09-30-2015 06:24 AM)xset Wrote: 7) Screen keyboard (because my eyes crying looking at orange letters on gray), useful with capacitive stylus. YES ! We need a virtual keyboard that we can popup quickly. Thank you xset. Alpha keys are not readable on physical keyboard, I don't konw if hp fixed that on later hardware revision, or plan to do it... RE: Program to search inside programs - StephenG1CMZ - 09-30-2015 08:35 AM (09-30-2015 08:04 AM)hpfx Wrote:(09-30-2015 06:24 AM)xset Wrote: 7) Screen keyboard (because my eyes crying looking at orange letters on gray), useful with capacitive stylus. As well as improving visibility, a QWERTY pop-up would be useful. RE: Program to search inside programs - xset - 09-30-2015 09:41 AM (09-30-2015 07:55 AM)StephenG1CMZ Wrote: Could you add searching of Notes too? Not a problem, it's time to extract functions which actually does parsing, searching and use them on anything including Notes. Need to find some modular OOP-like technology for development, that is sad HPPL is not Lua :-( RE: Program to search inside programs - StephenG1CMZ - 09-30-2015 03:13 PM On the Android emulator I find that when I cut and paste the code, there appears to be a space within one SIZE. Deleting that one space, it compiles OK. The User S Search sequence works great, but the User G Globalsearch is ineffective: After entering the search text, it drops back to the edited text inserting SIN() into the text. If I attempt to Run the Globalsearch from your code, instead of from a file one is editing, I get an insufficient memory error. I suspect it's just that the code being searched is too big. Update: Instead of using MAKELIST to make one big list, looping through each file in turn would reduce the memory required. But that User S search within program is a great feature. RE: Program to search inside programs - xset - 09-30-2015 04:30 PM (09-30-2015 03:13 PM)StephenG1CMZ Wrote: On the Android emulator I find that when I cut and paste the code, there appears to be a space within one SIZE. Deleting that one space, it compiles OK. Better use attached hpprgm, i also have found some bugs with copied text. (09-30-2015 03:13 PM)StephenG1CMZ Wrote: If I attempt to Run the Globalsearch from your code, instead of from a file one is editing, I get an insufficient memory error. I suspect it's just that the code being searched is too big. You can change K_Sin() with K_8() OR KA_9() to move shortcut to appropriate keys. I am currently working on universal search (current program, all programs, notes). I though new cool feature for the editor, which also will be implemented there. I killed many hours trying to construct fast function calls "by pointer" but they still costs at least triple of direct call :-( Why HP banned "program" concept from RPL, you could pass symbol and eval it fast. EXPR is too slow. I am missing pointers to functions to write clean extendable code. :-( Looks like we can not avoid text code generation in some language higher than HPPL, but I can't figure how to implement "function as value" conception in absence of "program as value" mechanisms :-( RE: Program to search inside programs - StephenG1CMZ - 09-30-2015 05:02 PM On the Android emulator I don't think you can use hpprgm - it has to be cut and paste AFAIK. Version 0.3 - xset - 09-30-2015 05:09 PM This version includes: 1) Searching in current program (or in last edited) Shift-USER S (S is button [9]) 2) Searching in all programs Shift-USER Shift-S (S is button [9]) 3) Searching in current note (or in last edited Note if u are not in editor) Shift-USER Note (Note is button [0]) 4) Searching in all notes Shift-USER Shift-Note (Note is button [0]) The program now contains semi-unversal function GlobSearch with arguments: str, IType, BCaseSense str - string to search. IType: 1 - Local searching in program, 2- Global searching in programs, 3-Local searching in note, 4-Global searching in notes. BCaseSense: 1 - Case insensitive, other values - Case sensitive Currently I hardcoded case insensitive search everywhere, so one need to change searching dialog to add check box for sensitive searching (just in case). Text of program, but better use attached file: Code:
Best regards XSet RE: Program to search inside programs - xset - 09-30-2015 05:18 PM (09-30-2015 05:02 PM)StephenG1CMZ Wrote: On the Android emulator I don't think you can use hpprgm - it has to be cut and paste AFAIK. Life is life. But I also publish texts copied from Connectivity Kit window, so I hope it will be useful on Android as well. |