Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How to "automate" displaying Instant messages

Author
Message
holger at home
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location:
Posted: 24th Mar 2010 10:39
hey @ all,
after a very long periode of trying i achiefed to program an Instant messenger. Means messages are send, recieved and displayed in real time! This was hard enough for me as a beginner. Until i got that to work i just used the primitive way to display messages with if..then.

example:


i gave each message a number, textsize = 20
and the latest message shall always be displayed at the
coords: x = 0, y = 400.
the previous message shall then be deleted at the ols coords and displayed at the new coords: x = 0, y = 380 until y = 0
example:


I think the best way would be to a recordtype
like this:

type messagetype
mes as string
message_no as integer
cursor_y as integer
endtype

and then read them in in an array
dim messages(0) as messagetype

But how to go on? how can i automate this ? I want to display always the last 20 messages. ( message_no 20 = cursor_y = (y) 0

hope so much that you can help me
many thx
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Mar 2010 12:37 Edited at: 25th Mar 2010 12:50
have alook at this and see if what you might be looking for.

used the select command set and a timer delay to display the text.



same code but without using the cls command to clear the screen.


Dark Physics makes any hot drink go cold.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 27th Mar 2010 11:45
@HowDo: I don't really think it's very efficient to create a unique case clause for every message you want to display. What if you wanted to display the last 100 messages? Also, the case numbers you're using seem to line up perfectly with your array indexes, so why not just do this?



Also, you could use the backdrop on command to turn on the automatically refreshing backdrop without creating a pointless object.

@holger at home: It sounds like you need a list filled with messages, and only to display the last 20? Check this out:



Hopefully that will start you on the right track.
holger at home
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location:
Posted: 28th Mar 2010 12:26
many many thx that's exactly that what i need
On the very first view i'm wondering that you call the "array insert at top" order in the do..loop once more, although you did so as you created the array before. Seems that was my mistake.

Now i have to figure out how to implement this in my code
as well as it has to work also with recieved messages.

Hope so much that you would help me again if i have probs with it

yours holger
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 28th Mar 2010 16:08
Of course I would
Post back if any issues come up. Good luck.

Login to post a reply

Server time is: 2024-11-23 19:23:38
Your offset time is: 2024-11-23 19:23:38