[Solved] Way to add basic 1 or 0?

Discuss the presentation application
Post Reply
chuckledarkly
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

[Solved] Way to add basic 1 or 0?

Post by chuckledarkly »

Hello again!

My last question was solved super quick but i feel like this one is much harder. Is there a way to add a basic tracker of some sort? What I mean by this is could i add a button that when clicked on will do something different depending on whether or not another button has been pressed?

If this doesn't make sense i'll explain. I am making a slideshow for kids but I want to give them different final slides based on the answers they clicked along the way. Is some sort of tally or 1 or 0 switch possible?

If you have any ideas let me know, and Thanks!
Last edited by chuckledarkly on Thu Apr 13, 2017 12:34 pm, edited 1 time in total.
windows10, OpenOffice3.1
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Post by RoryOF »

Let button1 set a flag to say it has been pressed. Then in button2 code add an IF condition that looks at button1 flag and does the complex operation, ELSE it does the simple button2 code. When you decide to reset the button1 flag is up to you - you might not wish it to be active for the duration of a session.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
chuckledarkly
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

Re: Way to add basic 1 or 0?

Post by chuckledarkly »

yes that sounds like what I want to do but how would i go about it? My experience in impress is very light.
windows10, OpenOffice3.1
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Post by RoryOF »

You are now into OpenOffice Macro Programming; this will keep you busy and out of pubs for months, or else will drive you to drink.
Start with the OO Basic guide

There is a complete downloadable version of an earlier edition (which should adequately meet your needs) at
OO BASIC guide 3.2 PDF
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Post by RoryOF »

Some careful searches for OpenOffice (or LibreOffice) macros ought point you to existing code, which you may then need to modify for your purposes, in the light of your knowledge of BASIC or other computer coding.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
chuckledarkly
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

Re: Way to add basic 1 or 0?

Post by chuckledarkly »

Thanks for the info! Guess ill give it a whirl, maybe ill get lucky and fine some youtube video tutorials haha!
windows10, OpenOffice3.1
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Way to add basic 1 or 0?

Post by RoryOF »

Youtube tutorials are no substitute for reading the documentation. The usual starting point for this is Andrew Pitonyak's works on macro programming, downloadable from
http://www.pitonyak.org/oo.php
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply