Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Marquee implementation in C

Reply
Thread Tools

Marquee implementation in C

 
 
praveen
Guest
Posts: n/a
 
      10-07-2007
Hi,

I want to scroll the text horizontally up to maximum of 50 characters
without using widgets.
How can i scroll the text ?
Give code snippet for this marquee implementation using C.

Thanks&Regards,
Rahul.

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      10-07-2007
praveen wrote:
> Hi,
>
> I want to scroll the text horizontally up to maximum of 50 characters
> without using widgets.


This isn't the place to ask, try a group dedicated to your operating system.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      10-07-2007
Ian Collins wrote:
> praveen wrote:
>> Hi,
>>
>> I want to scroll the text horizontally up to maximum of 50 characters
>> without using widgets.

>
> This isn't the place to ask, try a group dedicated to your operating system.
>

Although I guess you could simply use puts in a loop.

--
Ian Collins.
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      10-07-2007
Ian Collins wrote:

> Ian Collins wrote:
>> praveen wrote:
>>> Hi,
>>>
>>> I want to scroll the text horizontally up to maximum of 50
>>> characters without using widgets.

>>
>> This isn't the place to ask, try a group dedicated to your operating
>> system.
>>

> Although I guess you could simply use puts in a loop.


I don't think it's possible without some dependence on implementation
defined behaviour. The easiest solution would be use some similar to
curses.

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      10-07-2007
santosh <(E-Mail Removed)> writes:
> Ian Collins wrote:
>> Ian Collins wrote:
>>> praveen wrote:
>>>> I want to scroll the text horizontally up to maximum of 50
>>>> characters without using widgets.
>>>
>>> This isn't the place to ask, try a group dedicated to your operating
>>> system.
>>>

>> Although I guess you could simply use puts in a loop.

>
> I don't think it's possible without some dependence on implementation
> defined behaviour. The easiest solution would be use some similar to
> curses.


It can be done if the carriage return character behaves as specified.
But I'm unwilling to do the OP's homework for him.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      10-07-2007
Keith Thompson wrote:

> santosh <(E-Mail Removed)> writes:
>> Ian Collins wrote:
>>> Ian Collins wrote:
>>>> praveen wrote:
>>>>> I want to scroll the text horizontally up to maximum of 50
>>>>> characters without using widgets.
>>>>
>>>> This isn't the place to ask, try a group dedicated to your
>>>> operating system.
>>>>
>>> Although I guess you could simply use puts in a loop.

>>
>> I don't think it's possible without some dependence on implementation
>> defined behaviour. The easiest solution would be use some similar to
>> curses.

>
> It can be done if the carriage return character behaves as specified.
> But I'm unwilling to do the OP's homework for him.


Since that behaviour is unspecified the program, correct me if I'm
wrong, would depend on implementation specified behavior.

Also the OP has not specified exactly what he means by "scroll."

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      10-07-2007
santosh <(E-Mail Removed)> writes:
> Keith Thompson wrote:
>> santosh <(E-Mail Removed)> writes:
>>> Ian Collins wrote:
>>>> Ian Collins wrote:
>>>>> praveen wrote:
>>>>>> I want to scroll the text horizontally up to maximum of 50
>>>>>> characters without using widgets.
>>>>>
>>>>> This isn't the place to ask, try a group dedicated to your
>>>>> operating system.
>>>>>
>>>> Although I guess you could simply use puts in a loop.
>>>
>>> I don't think it's possible without some dependence on implementation
>>> defined behaviour. The easiest solution would be use some similar to
>>> curses.

>>
>> It can be done if the carriage return character behaves as specified.
>> But I'm unwilling to do the OP's homework for him.

>
> Since that behaviour is unspecified the program, correct me if I'm
> wrong, would depend on implementation specified behavior.


C99 5.2.2p2 "Character display semantics":

Alphabetic escape sequences representing nongraphic characters in
the execution character set are intended to produce actions on
display devices as follows:

...

\r (carriage return) Moves the active position to the initial
position of the current line.

The weasel wording "are intended to" allows for considerable
variation, of course. For example, most of the terminal emulators I
use ignore the form feed character.

> Also the OP has not specified exactly what he means by "scroll."


True.

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Martin Wells
Guest
Posts: n/a
 
      10-07-2007
On Oct 7, 7:55 am, Ian Collins <(E-Mail Removed)> wrote:
> praveen wrote:
> > Hi,

>
> > I want to scroll the text horizontally up to maximum of 50 characters
> > without using widgets.

>
> This isn't the place to ask, try a group dedicated to your operating system.



#define WIDGET_USAGE 0

#define MAX_SCROLL_CHAR 50

#include <stdio.h>

void Scroll(char const *str)
{
while (*str++)
{
puts(stdin,getsInLen(), MAX_SCROLL_CHAR);
}
}


Make sure you define "MAX_SCROLL_CHAR" before you include stdio.h.

Martin

 
Reply With Quote
 
Coos Haak
Guest
Posts: n/a
 
      10-08-2007
Op Sun, 07 Oct 2007 15:37:54 -0700 schreef Martin Wells:

> On Oct 7, 7:55 am, Ian Collins <(E-Mail Removed)> wrote:
>> praveen wrote:
>>> Hi,

>>
>>> I want to scroll the text horizontally up to maximum of 50 characters
>>> without using widgets.

>>
>> This isn't the place to ask, try a group dedicated to your operating system.

>
>
> #define WIDGET_USAGE 0
>
> #define MAX_SCROLL_CHAR 50
>
> #include <stdio.h>
>
> void Scroll(char const *str)
> {
> while (*str++)
> {
> puts(stdin,getsInLen(), MAX_SCROLL_CHAR);
> }
> }
>
>
> Make sure you define "MAX_SCROLL_CHAR" before you include stdio.h.
>

How did you learn C, from the Dead C scrolls perhaps ;-(
--
Coos
 
Reply With Quote
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      10-08-2007
[comp.lang.c] santosh <(E-Mail Removed)> wrote:

>>> praveen wrote:
>>>>
>>>> I want to scroll the text horizontally up to maximum of 50
>>>> characters without using widgets.


> I don't think it's possible without some dependence on implementation
> defined behaviour. The easiest solution would be use some similar to
> curses.


Obviously curses is probably the "right" answer, but one could hack
together something standard that might meet the letter of the
requirements, assuming knowledge of the number of columns and lines on
the terminal window and busy waiting to moderate the screen "redraw"
rate.

--
C. Benson Manica | I appreciate all corrections, polite or otherwise.
cbmanica(at)gmail.com |
----------------------| I do not currently read any posts posted through
sdf.lonestar.org | Google groups, due to rampant unchecked spam.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transparent items marquee? UJ ASP .Net 0 04-25-2006 05:47 PM
MARQUEE =?Utf-8?B?TWFyZWsgRw==?= ASP .Net 1 02-20-2006 04:18 PM
how to use marquee in asp.net? =?Utf-8?B?RGFuaWVs?= ASP .Net 3 10-06-2005 08:28 PM
Marquee from database =?Utf-8?B?QWxp?= ASP .Net 1 04-06-2005 11:14 AM
Marquee with a dataset? et ASP .Net 1 10-17-2004 04:11 PM



Advertisments