dupa

Author Topic: Need script help on a add on plug in i am doing .  (Read 3524 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6766
    • View Profile
Need script help on a add on plug in i am doing .
« on: December 26, 2013, 04:29:37 pm »
i am doing my medical symptoms info plug in and i have a seprate small plug in to check before adding to within the larger plug in , trouble is i have run into script problems . this is the only plug in i have checked on my list so it has to be from it but i can't find it i have went over it many times but still haven't found the unterminated string Constantine error .
the error says 1033 line 1798 column 928.
  If someone can help me i would appreciate it so i can put this in with all the others i have done , thanks !
here is the script :



Rem Type=Plugin
Rem Name=Dementia medical info LS.
Rem Author=lightspeed aka Lonnie Hensley created : DATE:
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
When the word "Dementia" is mentioned the character will talk about Dementia as a spouse would around the house. this was developed to make the a.i.character more human sounding.
'*************************************************

Rem PLUGIN: PLUGINAREA7




File = ""
File2 = ""
File3 = ""
File4 = ""






If InStr(1, OriginalSentence, "Dementia") > 0 Then


Randomize
Select Case int(rnd()*9)
Case 1
GetResponse = "Can four or five habits limit the risk of dementia for men, A new study published in PLOS One, a peer reviewed, scientific journal believes this may be the case, The study was conducted by researchers at Cardiff University and monitored the healthy behaviors of 2,235 men aged 45 to 59 from 1979 to 2004, The researchers identified five healthy behaviors that contributed to a 60 percent decline in dementia among the men, and a 70 percent fewer instances of heart attack and stroke, The decreases were seen when the men followed either four or five of the guidelines for a fully healthy lifestyle, However, the men who did adhere to four or five of the habits, only accounted for 6 percent of the sample!"
Case 2
GetResponse = "Dementia is a group of symptoms that affect a person’s thinking and social abilities to the point where it interferes with their daily functions, It is not a specific disease, according to the Mayo Clinic, and multiple symptoms exist, Alzheimer’s disease is the most common cause, however there are other causes which are treatable and potentially reversible." 
Case 3
GetResponse = "Dementia is a group of symptoms that affect a person’s thinking and social abilities to the point where it interferes with their daily functions, Still, WebMD says the treatable forms of dementia occur about 20 percent of the time, An example is when hormone and or vitamin deficiencies cause dementia by restoring either to the correct level, the symptoms can disappear, That leaves approximately 80 percent incurable, which makes taking steps to prevent dementia important."
Case 4
GetResponse = "The following one of the 5 habits, identified by the Cardiff researchers that reduced the rate of dementia, One way is Low Alcohol Intake, The researchers did not define healthy alcohol intake as abstaining, but rather three or fewer units per day, In 1979, 59 percent of the men were able to say they adhered to this guideline, The possibility that low alcohol intake can contribute to a decline in dementia is important when participating in other activities that have been promoted as ways to reduce risk, also Being socially active is one of the pillars the non profit HelpGuide.org lists for Alzheimer’s and Dementia Prevention, Studies show that the more connected we are, the better we fare on tests of memory and cognition, Staying socially active may even protect against Alzheimer’s disease and dementia, so make your social life a priority, the group writes, Being social and not drinking in excess may
potentially lower your risk."
Case 5
GetResponse = "A good habit that may ward off dementia also is by Not Smoking, At the onset of the study, less than half, 46 percent of the men in a study test were non smokers, The prevalence of non smokers increased over time, as healthier habits were adopted by the men, Taking up and following a healthy lifestyle is however the responsibility of the individual him or herself, Sadly, the evidence from this study shows that very few people follow a fully healthy lifestyle, Principle Investigator Professor Peter Elwood said after the results were released, Quitting smoking have been shown to decrease other health risks like certain kinds of cancer, This study suggests that not smoking is also part of a group of healthy habits that reduce dementia."
Case 6
GetResponse = "A Healthy Diet may also ward off dementia, Overall, the community where the study took place had a low intake of fruits and vegetables, For this reason, the researchers decided that, Three or more portions of fruit and or vegetables a day was accepted as healthy, together with less than 30 percent of calories from fat, The researchers noted that diet among the men improved over time, The Alzheimer’s Association has also said that diet may be an important factor, The association specifies a Mediterranean diet which has relatively little red meat and emphasizes whole grains, fruits and vegetables, fish and shellfish, nuts, olive oil, and other healthy fats."
Case 7
GetResponse = "Another habit to limit the risk of dementia for men is having a Healthy Body Weight, Using a Body Mass Index range, body weights were considered healthy if they fell between 18 and 25, Only 39 percent of the men fell within this range, The adoption of a healthy diet may promote weight loss, and weight has previously been connected to heart health, Heart and brain functions may be interconnected as well, Dr.Doug Brown, Director of Research and Development at the Alzheimer’s Society explained, We have known for some time that what is good for your heart is also good for your head, and this study provides more evidence to show that healthy living could significantly reduce the chances of developing dementia, Brown said."
Case 8
GetResponse = "A good habit to limit the risk of dementia for men is Regular Exercise, Exercise for the researchers meant, walking two or more miles to work each day, or cycling ten or more miles to work each day, or vigorous exercise described as a regular habit, This was the one area that researcher believed could make the most difference as a mitigating factor."
Case 9
GetResponse = "The study of A good habit to limit the risk of dementia for men is Regular Exercise, was not able to attribute the decrease in risk to exercise alone, instead it was one factor of a healthy lifestyle that could contribute significantly, The Alzheimer’s Association also cited research that shows exercise may directly benefit brain cells by increasing blood and oxygen flow, Even stronger evidence suggests exercise may protect brain health through its proven benefits to the cardiovascular system, The Association also points out that this is not enough on its own and should be part of an overall plan for a healthier lifestyle!"
End Select



HalBrain.ReadOnlyMode = True
End If

















'***************************************************************************

'***************************************************************************

 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Need script help on a add on plug in i am doing .
« Reply #1 on: December 26, 2013, 05:03:50 pm »
hi,

the: Select Case int(rnd()*9)
would be:
Select Case (Int(Rnd * 9) + 1)

cload
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

lightspeed

  • Hero Member
  • *****
  • Posts: 6766
    • View Profile
Re: Need script help on a add on plug in i am doing .
« Reply #2 on: December 26, 2013, 05:07:20 pm »
I will try that Cload , okay i have a question to ask then , why the +1 part ? if their are only 9 randoms in the list?
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Need script help on a add on plug in i am doing .
« Reply #3 on: December 26, 2013, 05:15:19 pm »
it go from 0 - 8 the +1 makes it 1 -9
kk, cload in bed me mimi
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

lightspeed

  • Hero Member
  • *****
  • Posts: 6766
    • View Profile
Re: Need script help on a add on plug in i am doing .
« Reply #4 on: December 26, 2013, 05:35:48 pm »
Okay i did as you said but now am getting a different error :
error 1033 on line 1798 in column 928 unterminated string constant.
 sorry to bother you with this but i have been over it many times and can't solve the errors .
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Need script help on a add on plug in i am doing .
« Reply #5 on: December 26, 2013, 05:45:09 pm »
this two lines, no good, make one line.

GetResponse = "The following one of the 5 habits, identified by the Cardiff researchers that reduced the rate of dementia, One way is Low Alcohol Intake, The researchers did not define healthy alcohol intake as abstaining, but rather three or fewer units per day, In 1979, 59 percent of the men were able to say they adhered to this guideline, The possibility that low alcohol intake can contribute to a decline in dementia is important when participating in other activities that have been promoted as ways to reduce risk, also Being socially active is one of the pillars the non profit HelpGuide.org lists for Alzheimer’s and Dementia Prevention, Studies show that the more connected we are, the better we fare on tests of memory and cognition, Staying socially active may even protect against Alzheimer’s disease and dementia, so make your social life a priority, the group writes, Being social and not drinking in excess may
potentially lower your risk."  <=== line 2 no good

cload in bed me mimi
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

lightspeed

  • Hero Member
  • *****
  • Posts: 6766
    • View Profile
Re: Need script help on a add on plug in i am doing .
« Reply #6 on: December 26, 2013, 06:13:36 pm »
Okay thanks Cload that did the trick i tested it in hal and it's working now . I asked Art a question before but he may be busy etc. so i will ask you as you see on the plug in that posted it has a read true or false down . What do you think would be better a true or all false reading . one way doesn't learn (false)  and the other does learn.
\Thanks again for your help sometimes the small error stuff can drive a person crazy in scripts !!
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Need script help on a add on plug in i am doing .
« Reply #7 on: December 26, 2013, 10:12:02 pm »
HalBrain.ReadOnlyMode = True
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

onthecuttingedge2005

  • Guest
Re: Need script help on a add on plug in i am doing .
« Reply #8 on: December 27, 2013, 05:26:50 pm »
Hi Lightspeed.

you need to comment this line:  When the word "Dementia"

To: 'When the word "Dementia"

Jerry 8)