# Revision history [back]

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT) as double REM predicts the amount adjusted for inflation dim Amplitude as double dim Delta as double dim H as double dim V as double dim Period as double dim r as double dim Inflation_Rate as double

Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to UBound(x)
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i



End Function

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT) AMT, optioanal Future_Year) as double REM predicts the amount adjusted for inflation dim Amplitude as double dim Delta as double dim H as double dim V as double dim Period as double dim r as double dim Inflation_Rate as double

Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to UBound(x)
Future_Year
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i



End Function

 3 None Ratslinger 16503 ●8 ●29 ●98

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT, optioanal Future_Year) as double REM predicts the amount adjusted for inflation dim Amplitude as double dim Delta as double dim H as double dim V as double dim Period as double dim r as double dim Inflation_Rate as double

Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to Future_Year
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i

End Function


End Function

 4 None Ratslinger 16503 ●8 ●29 ●98

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT, optioanal Future_Year) as double REM predicts the amount adjusted for inflation dim Amplitude as double dim Delta as double dim H as double dim V as double dim Period as double dim r as double dim Inflation_Rate as double

Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to Future_Year
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i

End Function

 5 None Ratslinger 16503 ●8 ●29 ●98

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT, optioanal Future_Year) as double REM predicts the amount adjusted for inflation dim Amplitude as double dim Delta as double dim H as double dim V as double dim Period as double dim r as double dim Inflation_Rate as double

 Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to Future_Year
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i

End Function

 6 None Ratslinger 16503 ●8 ●29 ●98

### Why does My Macro Function give error: Inadmissible value or data type. Index out of defined range.

Edited by @Ratslinger for clarity:

Function INFLATION_ADJUSTED(optional x(),optional y(),optional AMT, optioanal Future_Year) as double
REM predicts the amount adjusted for inflation
dim Amplitude as double
dim Delta as double
dim H as double
dim V as double
dim Period as double
dim r as double
dim Inflation_Rate as double double

Delta = ((y(1,1)-y(0,1)))
Amplitude = scr(y(0,1)^2 - Delta^2)
Period = PI()/UBound(x)
H = ASIN(y(0,1)/Period)
V = 0

For n = 0 to x
V = V + y(n,1)/UBound(x)
Next n

For i = 0 to Future_Year
Inflation_Rate = (Amplitude*SIN(Period*(i)+H)+V)
r = AMT*(1-Inflation_Rate/100)
Next i

End Function






 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license. ⬆ to top impressum (legal info) | about | faq | help | privacy policy | give feedback Powered by Askbot version 0.9.3 var _paq = _paq || []; _paq.push(["disableCookies"]); _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.documentfoundation.org/"; _paq.push(["setTrackerUrl", u+"piwik.php"]); _paq.push(["setSiteId", "55"]); var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); })(); Please note: AskLibO requires javascript to work properly, please enable javascript in your browser, here is how //IE fix to hide the red margin var noscript = document.getElementsByTagName('noscript')[0]; noscript.style.padding = '0px'; noscript.style.backgroundColor = 'transparent'; askbot['urls']['mark_read_message'] = '/en/s/messages/markread/'; askbot['urls']['get_tags_by_wildcard'] = '/en/s/get-tags-by-wildcard/'; askbot['urls']['get_tag_list'] = '/en/s/get-tag-list/'; askbot['urls']['follow_user'] = '/followit/follow/user/{{userId}}/'; askbot['urls']['unfollow_user'] = '/followit/unfollow/user/{{userId}}/'; askbot['urls']['user_signin'] = '/en/account/signin/'; askbot['urls']['getEditor'] = '/en/s/get-editor/'; askbot['urls']['translateUrl'] = '/en/s/translate-url/'; askbot['urls']['apiGetQuestions'] = '/en/s/api/get_questions/'; askbot['urls']['ask'] = '/en/questions/ask/'; askbot['urls']['questions'] = '/en/questions/'; askbot['settings']['groupsEnabled'] = false; askbot['settings']['static_url'] = '/m/'; askbot['settings']['minSearchWordLength'] = 4; askbot['settings']['mathjaxEnabled'] = false; askbot['settings']['sharingSuffixText'] = '#Ask_LIbreOffice'; askbot['settings']['errorPlacement'] = 'after-label'; askbot['data']['maxCommentLength'] = 1000; askbot['settings']['editorType'] = 'markdown'; askbot['settings']['commentsEditorType'] = 'rich\u002Dtext'; askbot['messages']['askYourQuestion'] = 'Ask Your Question'; askbot['messages']['acceptOwnAnswer'] = 'accept or unaccept your own answer'; askbot['messages']['followQuestions'] = 'follow questions'; askbot['settings']['allowedUploadFileTypes'] = [ "jpg", "jpeg", "gif", "bmp", "png", "tiff", "odt", "ods", "odp", "odg", "odc", "odf", "odi", "odm", "ott", "ots", "otp", "otg", "odb", "doc", "docx", "xls", "xlsx", "ppt", "pptx" ]; askbot['data']['haveFlashNotifications'] = true; askbot['data']['activeTab'] = 'questions'; askbot['settings']['csrfCookieName'] = 'ask.libreoffice.org_en_csrf'; askbot['data']['searchUrl'] = ''; /*<![CDATA[*/ $('.mceStatusbar').remove();//a hack to remove the tinyMCE status bar$(document).ready(function(){ // focus input on the search bar endcomment var activeTab = askbot['data']['activeTab']; if (inArray(activeTab, ['users', 'questions', 'tags', 'badges'])) { var searchInput = $('#keywords'); } else if (activeTab === 'ask') { var searchInput =$('#id_title'); } else { var searchInput = undefined; animateHashes(); } var wasScrolled = $('#scroll-mem').val(); if (searchInput && !wasScrolled) { searchInput.focus(); putCursorAtEnd(searchInput); } var haveFullTextSearchTab = inArray(activeTab, ['questions', 'badges', 'ask']); var haveUserProfilePage =$('body').hasClass('user-profile-page'); if ((haveUserProfilePage || haveFullTextSearchTab) && searchInput && searchInput.length) { var search = new FullTextSearch(); askbot['controllers'] = askbot['controllers'] || {}; askbot['controllers']['fullTextSearch'] = search; search.setSearchUrl(askbot['data']['searchUrl']); if (activeTab === 'ask') { search.setAskButtonEnabled(false); } search.decorate(searchInput); } else if (activeTab === 'tags') { var search = new TagSearch(); search.decorate(searchInput); } if (askbot['data']['userIsAdminOrMod']) { $('body').addClass('admin'); } if (askbot['settings']['groupsEnabled']) { askbot['urls']['add_group'] = "/en/s/add-group/"; var group_dropdown = new GroupDropdown();$('.groups-dropdown').append(group_dropdown.getElement()); } var userRep = $('#userToolsNav .reputation'); if (userRep.length) { var showPermsTrigger = new ShowPermsTrigger(); showPermsTrigger.decorate(userRep); } }); if (askbot['data']['haveFlashNotifications']) {$('#validate_email_alert').click(function(){notify.close(true)}) notify.show(); } var langNav = $('.lang-nav'); if (langNav.length) { var nav = new LangNav(); nav.decorate(langNav); } /*]]>*/$(document).ready(function() { var toTop=$("#toTop"); if ($(window).scrollTop() == 0) { toTop.fadeOut(1000); } $(window).scroll(function() { if ($(this).scrollTop() != 0) { toTop.fadeIn(); } else { toTop.fadeOut(); } }); toTop.click(function(event) { event.preventDefault(); $("html,body").animate({scrollTop: 0},800); }); }); //todo - take this out into .js file$(document).ready(function(){ $('div.revision div[id^=rev-header-]').bind('click', function(){ var revId = this.id.substr(11); toggleRev(revId); }); lanai.highlightSyntax(); }); function toggleRev(id) { var arrow =$("#rev-arrow-" + id); var visible = arrow.attr("src").indexOf("hide") > -1; if (visible) { var image_path = '/m/default/media/images/expander-arrow-show.gif?v=20'; } else { var image_path = '/m/default/media/images/expander-arrow-hide.gif?v=20'; } image_path = image_path + "?v=20"; arrow.attr("src", image_path); \$("#rev-body-" + id).slideToggle("fast"); } for (url_name in askbot['urls']){ askbot['urls'][url_name] = cleanUrl(askbot['urls'][url_name]); }