Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 93 users online: 3 members, 66 guests and 24 bots. Members: luoxue. Bots: MSN/Bing (1), Magpie Crawler (3), Googlebot (18), MSN/Bing (2).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
the_mad_joob

Newbie

Joined: 11 Dec 2011 Posts: 23
|
Posted: 12 Dec 2011 02:08:28 pm Post subject: 8X+ > opening the prgm editor upon exiting an app |
|
|
Yo there...
Here is where i need help :
I need to find a way to automatically open up the os prgm editor for a defined prgm, right after exiting the application i'm working on.
I precise i don't need to return back to the app code after doing so.
Also, the idea is to be able to make the cursor point to the location i want.
I already have the obj+name and error token address for the concerned prgm.
Before you ask, no need to call _jerror cause my app already displays its own error messages.
If you know "Axe", this is exactly how i want it to work (when [PRGM] is pressed if an error is encountered).
Unfortunately, its creator doesn't answer my call so i hope someone can around here...
Thx in advance =] |
|
| Back to top |
|
|
quigibo

New Member

Joined: 24 Jan 2009 Posts: 89 Location: Los Angeles
|
Posted: 14 Dec 2011 06:26:53 am Post subject: |
|
|
I actually just fixed that routine recently Maybe Kerm will fix it in DCS too if he didn't already, which I think he might of since that was over a year ago.
Anyway, here goes. There are 2 blanks that need to be filled in depending on which program, and where in the program you plan to jump to. Sorry its not commented...
Code:
EditorExit:
;'HL points to the name of the program to edit'
ld hl,_Your_Prgm_Name_
ld de,progToEdit
ld bc,8
ldir
xor a
ld (de),a
ld a,kPrgmEd
B_CALL(_NewContext)
;'BC should hold the offset you would like to jump to'
ld bc,_Your_Offset_
ld de,(editTop)
ld hl,(editTail)
ldir
ld (editCursor),de
ld (editTail),hl
ld h,b
ld l,c
push hl
EditorLoop:
ld de,(editTop)
or a
sbc hl,de
jr z,EditorFound
B_CALL(_BufLeft)
ld hl,(editCursor)
ld a,(hl)
cp tEnter
jr z,EditorFound
pop hl
inc hl
push hl
jr EditorLoop
EditorFound:
B_CALL(_BufRight)
B_CALL(_DispEOW)
pop hl
ld a,h
or l
jr z,EditorMon
EditorScroll:
dec hl
ld a,h
or l
jr z,EditorMon
push hl
B_CALL(_CursorRight)
pop hl
jr EditorScroll
EditorMon:
res 2,(iy+50)
res 7,(iy+20)
res 3,(iy+5)
B_JUMP(_Mon)
|
|
| Back to top |
|
|
the_mad_joob

Newbie

Joined: 11 Dec 2011 Posts: 23
|
Posted: 14 Dec 2011 09:23:08 am Post subject: |
|
|
Thx man...
I'll give it a try as soon as possible.
U rock =] |
|
| Back to top |
|
|
the_mad_joob

Newbie

Joined: 11 Dec 2011 Posts: 23
|
Posted: 16 Dec 2011 05:58:38 pm Post subject: |
|
|
Just tried it.
It kinda works, except for 2 things :
1) It seems impossible to make the cursor point to a tenter token.
It'll automatically point to the next token instead.
2) It behaves very strangely if there is no tenter token before the inputted offset (in other words, if it's located in the first line of the prgm).
I'll try to figure out why... |
|
| Back to top |
|
|
quigibo

New Member

Joined: 24 Jan 2009 Posts: 89 Location: Los Angeles
|
Posted: 17 Dec 2011 10:51:27 pm Post subject: |
|
|
Oh right, that's because its directly from the Axe source where those effects are what I desire. Remove the "B_CALL(_BufRight)" if you want to be able to put the cursor over a tEnter token. I think this might solve both problems, but I'm not sure.
EDIT: Also move the "jr z,EditorFound" to after the pop inc push thing. |
|
| Back to top |
|
|
the_mad_joob

Newbie

Joined: 11 Dec 2011 Posts: 23
|
Posted: 18 Dec 2011 12:32:13 am Post subject: |
|
|
While doing some tests, i figured out how the whole thing works so i'm gonna modify it to suit my needs.
I actually found a way to avoid both the bufleft and bufright bcalls.
Anyway, there's a place for you in my project credits.
Thx again =] |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55764 Location: Earth, Sol, Milky Way
|
Posted: 21 Dec 2011 01:58:27 pm Post subject: |
|
|
Glad you were able to get this resolved, The_Mad_Joob. _________________
 |
|
| Back to top |
|
|
the_mad_joob

Newbie

Joined: 11 Dec 2011 Posts: 23
|
Posted: 23 Dec 2011 04:07:10 am Post subject: |
|
|
I'm glad you're glad.
Thx =] |
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.026848 seconds.
|